[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/07: syscalls: Second argument of packed-struct read is now optional.
From: |
Ludovic Courtès |
Subject: |
03/07: syscalls: Second argument of packed-struct read is now optional. |
Date: |
Mon, 25 Apr 2016 21:35:32 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit f77863a09eebf65299e734d27f1c5b96e9742f52
Author: Ludovic Courtès <address@hidden>
Date: Mon Apr 25 15:41:59 2016 +0200
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'.
---
guix/build/syscalls.scm | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 4555506..7c32e25 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)))))
- branch master updated (a800018 -> 5cd25aa), Ludovic Courtès, 2016/04/25
- 07/07: syscalls: 'terminal-columns' catches EINVAL on the TIOCGWINSZ ioctl., Ludovic Courtès, 2016/04/25
- 06/07: guix gc: Add '--free-space'., Ludovic Courtès, 2016/04/25
- 01/07: Add "TasksMax=1024" in 'guix-daemon.service'., Ludovic Courtès, 2016/04/25
- 04/07: syscalls: 'define-c-struct' computes the struct size., Ludovic Courtès, 2016/04/25
- 02/07: syscalls: Move code around [NFC]., Ludovic Courtès, 2016/04/25
- 03/07: syscalls: Second argument of packed-struct read is now optional.,
Ludovic Courtès <=
- 05/07: syscalls: Add 'statfs'., Ludovic Courtès, 2016/04/25