From 5558cdaa302aba6ba493612fbea1fdac09db7d96 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 6 Jul 2012 11:01:51 +0200 Subject: add check for fchmod * configure.ac: Add a check for fchmod. * libguile/filesys.c (scm_chmod): Guard the fchmod case with HAVE_FCHMOD. --- libguile/filesys.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libguile/filesys.c') 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))); -- cgit v1.2.3