diff options
author | Andy Wingo <wingo@pobox.com> | 2012-07-06 11:01:51 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-07-06 11:01:51 +0200 |
commit | 5558cdaa302aba6ba493612fbea1fdac09db7d96 (patch) | |
tree | dfb599bc292ba69e42f9d2b4603035adb9f0961a /libguile/filesys.c | |
parent | fc30e14ffe550cfb088cf9f8b388b276663f6297 (diff) | |
download | guile-5558cdaa302aba6ba493612fbea1fdac09db7d96.tar.gz |
add check for fchmod
* configure.ac: Add a check for fchmod.
* libguile/filesys.c (scm_chmod): Guard the fchmod case with
HAVE_FCHMOD.
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r-- | libguile/filesys.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c index cdd9ae73c..9c39307b6 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -104,7 +104,6 @@ /* Some more definitions for the native Windows port. */ #ifdef __MINGW32__ # define fsync(fd) _commit (fd) -# define fchmod(fd, mode) (-1) #endif /* __MINGW32__ */ @@ -1335,12 +1334,13 @@ SCM_DEFINE (scm_chmod, "chmod", 2, 0, 0, #define FUNC_NAME s_scm_chmod { int rv; - int fdes; object = SCM_COERCE_OUTPORT (object); +#if HAVE_FCHMOD if (scm_is_integer (object) || SCM_OPFPORTP (object)) { + int fdes; if (scm_is_integer (object)) fdes = scm_to_int (object); else @@ -1348,6 +1348,7 @@ SCM_DEFINE (scm_chmod, "chmod", 2, 0, 0, SCM_SYSCALL (rv = fchmod (fdes, scm_to_int (mode))); } else +#endif { STRING_SYSCALL (object, c_object, rv = chmod (c_object, scm_to_int (mode))); |