summaryrefslogtreecommitdiff
path: root/libguile/filesys.c
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-05-18 08:47:52 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-05-18 08:47:52 +0000
commitaf45e3b06accc40d2c92918d5901afb793e8b247 (patch)
tree36558f693d2e1bdbcd89d8ff533c8852abf47435 /libguile/filesys.c
parentc8a54c4b87d561a6a4cc6464846af51f8215ef1e (diff)
downloadguile-af45e3b06accc40d2c92918d5901afb793e8b247.tar.gz
* Unified some rest argument checking and handling.
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r--libguile/filesys.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c
index bb20f5b78..8073225cb 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -1112,7 +1112,7 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0,
-SCM_DEFINE (scm_fcntl, "fcntl", 2, 0, 1,
+SCM_DEFINE (scm_fcntl, "fcntl", 2, 1, 0,
(SCM object, SCM cmd, SCM value),
"Apply @var{command} to the specified file descriptor or the underlying\n"
"file descriptor of the specified port. @var{value} is an optional\n"
@@ -1153,13 +1153,13 @@ SCM_DEFINE (scm_fcntl, "fcntl", 2, 0, 1,
SCM_VALIDATE_INUM (1,object);
fdes = SCM_INUM (object);
}
- if (SCM_NULLP (value))
+
+ if (SCM_UNBNDP (value)) {
ivalue = 0;
- else
- {
- SCM_ASSERT (SCM_INUMP (SCM_CAR (value)), value, SCM_ARG3, FUNC_NAME);
- ivalue = SCM_INUM (SCM_CAR (value));
- }
+ } else {
+ SCM_VALIDATE_INUM_COPY (SCM_ARG3, value, ivalue);
+ }
+
SCM_SYSCALL (rv = fcntl (fdes, SCM_INUM (cmd), ivalue));
if (rv == -1)
SCM_SYSERROR;