guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: file-systems: Improve error reporting.


From: Danny Milosavljevic
Subject: 02/02: file-systems: Improve error reporting.
Date: Wed, 31 May 2017 17:18:43 -0400 (EDT)

dannym pushed a commit to branch master
in repository guix.

commit 203a9455c4695152fc5d0085bffeead9ce3216c2
Author: Danny Milosavljevic <address@hidden>
Date:   Tue May 30 11:12:58 2017 +0200

    file-systems: Improve error reporting.
    
    Suggested by Chris Marusich <address@hidden>.
    Fixes <https://bugs.gnu.org/27143>.
    
    * gnu/build/file-systems.scm (read-iso9660-primary-volume-descriptor):
    Improve error reporting.
---
 gnu/build/file-systems.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 3b831c0..3e08733 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -245,7 +245,12 @@ Trailing spaces are trimmed."
   "Find and read the first primary volume descriptor, starting at OFFSET.
    Return #f if not found."
   (let* ((sblock    (read-superblock device offset 2048 iso9660-superblock?))
-         (type-code (if sblock (array-ref sblock 0) 255)))
+         (type-code (if sblock
+                        (bytevector-u8-ref sblock 0)
+                        (error (format #f
+                                       "Could not read ISO9660 primary
+volume descriptor from ~s"
+                                       device)))))
     (match type-code
       (255 #f) ; Volume Descriptor Set Terminator.
       (1 sblock) ; Primary Volume Descriptor



reply via email to

[Prev in Thread] Current Thread [Next in Thread]