summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-04-25 15:41:59 +0200
committerLudovic Courtès <ludo@gnu.org>2016-04-25 23:27:09 +0200
commitf77863a09eebf65299e734d27f1c5b96e9742f52 (patch)
treea71c0196f57142d67d8ffd259c3a9c8b6aeeccc5
parent73f38d5ff3621c7fbc69a6a5eea598ba269e8b2a (diff)
downloadguix-f77863a09eebf65299e734d27f1c5b96e9742f52.tar.gz
syscalls: Second argument of packed-struct read is now optional.
* guix/build/syscalls.scm (define-c-struct)[read]: OFFSET defaults to 0.
(unfold-interface-list): Remove second argument to 'read-ifaddrs'.
(terminal-window-size): Remove second argument to 'read-winsize'.
-rw-r--r--guix/build/syscalls.scm8
1 files changed, 3 insertions, 5 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 45555060f8..7c32e25971 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -199,7 +199,7 @@ structure with the given TYPES.  READ uses WRAP-FIELDS to return its value."
      (begin
        (define (write! bv offset fields ...)
          (write-types bv offset (types ...) (fields ...)))
-       (define (read bv offset)
+       (define* (read bv #:optional (offset 0))
          (read-types wrap-fields bv offset (types ...) ()))))))
 
 
@@ -858,8 +858,7 @@ return the list of resulting <interface> objects."
              (result '()))
     (if (null-pointer? ptr)
         (reverse result)
-        (match (read-ifaddrs (pointer->bytevector ptr %sizeof-ifaddrs)
-                             0)
+        (match (read-ifaddrs (pointer->bytevector ptr %sizeof-ifaddrs))
           ((ifaddr . ptr)
            (loop ptr (cons ifaddr result)))))))
 
@@ -921,8 +920,7 @@ corresponds to the TIOCGWINSZ ioctl."
          (ret  (%ioctl (fileno port) TIOCGWINSZ size))
          (err  (errno)))
     (if (zero? ret)
-        (read-winsize (pointer->bytevector size (sizeof winsize-struct))
-                      0)
+        (read-winsize (pointer->bytevector size (sizeof winsize-struct)))
         (throw 'system-error "terminal-window-size" "~A"
                (list (strerror err))
                (list err)))))