* filesys.c (scm_chown): omit port/fdes support if HAVE_FCHOWN is
authorGary Houston <ghouston@arglist.com>
Sun, 23 Jan 2000 20:25:27 +0000 (20:25 +0000)
committerGary Houston <ghouston@arglist.com>
Sun, 23 Jan 2000 20:25:27 +0000 (20:25 +0000)
not defined (thanks to Richard Y. Kim).

ChangeLog
THANKS
configure.in
libguile/ChangeLog
libguile/filesys.c

index de2969f..73636bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-01-23  Gary Houston  <ghouston@arglist.com>
+
+       * configure.in: check for fchown.
+
 Tue Jan 18 12:55:15 2000  Mikael Djurfeldt  <mdj@r11n07-s.pdc.kth.se>
 
        * acinclude.m4 (AC_LIBLTDL_CONVENIENCE): Add $(top_srcdir)/libltdl
diff --git a/THANKS b/THANKS
index be3adba..9639314 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -15,6 +15,7 @@ For fixes or providing information which led to a fix:
       Mark Galassi
       Greg Harvey
       Dirk Herrmann
+   Richard Kim
       Brad Knotwell
       Eric Moore
     Roland Orre
index 35a06fc..b17b2d9 100644 (file)
@@ -163,7 +163,7 @@ AC_SUBST(INCLTDL)
 AC_SUBST(LIBLTDL)
 AC_SUBST(DLPREOPEN)
 
-AC_CHECK_FUNCS(ctermid ftime getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid bzero strdup system usleep atexit on_exit)
+AC_CHECK_FUNCS(ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid bzero strdup system usleep atexit on_exit)
 
 ### Some systems don't declare some functions.  On such systems, we
 ### need to at least provide our own K&R-style declarations.
index abb5871..57ee72b 100644 (file)
@@ -1,3 +1,8 @@
+2000-01-23  Gary Houston  <ghouston@arglist.com>
+
+       * filesys.c (scm_chown): omit port/fdes support if HAVE_FCHOWN is 
+       not defined (thanks to Richard Y. Kim).
+
 Thu Jan 20 13:00:38 2000  Greg J. Badros  <gjb@cs.washington.edu>
 
        * Makefile.in: Removed, this is auto-generated.
index b1c6c93..b9552b9 100644 (file)
 
 SCM_DEFINE (scm_chown, "chown", 3, 0, 0, 
             (SCM object, SCM owner, SCM group),
-           "Change the ownership and group of the file referred to by @var{obj} to\n"
-           "the integer userid values @var{owner} and @var{group}.  @var{obj} can be\n"
-           "a string containing a file name or a port or integer file descriptor\n"
-           "which is open on the file (in which case fchown is used as the underlying\n"
-           "system call).  The return value\n"
+           "Change the ownership and group of the file referred to by @var{object} to\n"
+           "the integer values @var{owner} and @var{group}.  @var{object} can be\n"
+           "a string containing a file name or, if the platform\n"
+           "supports fchown, a port or integer file descriptor\n"
+           "which is open on the file.  The return value\n"
            "is unspecified.\n\n"
-           "If @var{obj} is a symbolic link, either the\n"
+           "If @var{object} is a symbolic link, either the\n"
            "ownership of the link or the ownership of the referenced file will be\n"
            "changed depending on the operating system (lchown is\n"
            "unsupported at present).  If @var{owner} or @var{group} is specified\n"
@@ -138,21 +138,21 @@ SCM_DEFINE (scm_chown, "chown", 3, 0, 0,
 #define FUNC_NAME s_scm_chown
 {
   int rv;
-  int fdes;
 
   object = SCM_COERCE_OUTPORT (object);
 
   SCM_VALIDATE_INUM (2,owner);
   SCM_VALIDATE_INUM (3,group);
+#ifdef HAVE_FCHOWN
   if (SCM_INUMP (object) || (SCM_OPFPORTP (object)))
     {
-      if (SCM_INUMP (object))
-       fdes = SCM_INUM (object);
-      else
-       fdes = SCM_FPORT_FDES (object);
+      int fdes = SCM_INUMP (object) ? SCM_INUM (object)
+       : SCM_FPORT_FDES (object);
+
       SCM_SYSCALL (rv = fchown (fdes, SCM_INUM (owner), SCM_INUM (group)));
     }
   else
+#endif
     {
       SCM_VALIDATE_ROSTRING(1,object);
       SCM_COERCE_SUBSTR (object);
@@ -821,6 +821,7 @@ static int
 set_element (SELECT_TYPE *set, SCM element, int arg)
 {
   int fd;
+
   element = SCM_COERCE_OUTPORT (element);
   if (SCM_OPFPORTP (element))
     fd = SCM_FPORT_FDES (element);