summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-03-27 12:01:05 +0200
committerLudovic Courtès <ludo@gnu.org>2023-03-27 18:48:52 +0200
commit836297eae5ebe5fd0d434056db64770acc3f3275 (patch)
tree04ccf896488a6d8e017268aa3abf399da4e95bc4 /guix
parent30cc651fbad4ba3e63b5ec555230ea46318ca938 (diff)
syscalls: 'getxattr' throws upon error.
* guix/build/syscalls.scm (getxattr): Throw in the negative SIZE case.
Diffstat (limited to 'guix')
-rw-r--r--guix/build/syscalls.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index df9b9f6ac7..d947b010d3 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -970,7 +970,10 @@ backend device."
(string->pointer key)
(string->pointer "")
0)))
- (cond ((< size 0) #f)
+ (cond ((< size 0)
+ (throw 'system-error "getxattr" "~S: ~A"
+ (list file key (strerror err))
+ (list err)))
((zero? size) "")
;; Get VALUE in buffer of SIZE. XXX actual size can race.
(else (let*-values (((buf) (make-bytevector size))