summaryrefslogtreecommitdiff
path: root/libguile/filesys.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-07-06 11:01:51 +0200
committerAndy Wingo <wingo@pobox.com>2012-07-06 11:01:51 +0200
commit5558cdaa302aba6ba493612fbea1fdac09db7d96 (patch)
treedfb599bc292ba69e42f9d2b4603035adb9f0961a /libguile/filesys.c
parentfc30e14ffe550cfb088cf9f8b388b276663f6297 (diff)
downloadguile-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.c5
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)));