changeset 10029:3b2f81d5a6dc

use gnulib modules for fstat, lstat, and stat
author John W. Eaton <jwe@octave.org>
date Sat, 26 Dec 2009 00:07:01 -0500
parents 52a248732bb6
children 83bb2a78c07d
files ChangeLog bootstrap.conf configure.ac liboctave/ChangeLog liboctave/file-stat.cc
diffstat 5 files changed, 17 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Dec 25 23:58:08 2009 -0500
+++ b/ChangeLog	Sat Dec 26 00:07:01 2009 -0500
@@ -1,3 +1,9 @@
+2009-12-26  John W. Eaton  <jwe@octave.org>
+
+	* bootstrap.conf (gnulib_modules): Include fstat, lstat, and
+	stat in the list.
+	* configure.ac: Don't check for fstat, lstat, or stat.
+
 2009-12-25  John W. Eaton  <jwe@octave.org>
 
 	* bootstrap.conf (gnulib_modules): Include mkdir in the list.
--- a/bootstrap.conf	Fri Dec 25 23:58:08 2009 -0500
+++ b/bootstrap.conf	Sat Dec 26 00:07:01 2009 -0500
@@ -20,8 +20,11 @@
 gnulib_modules="
   crypto/md5
   fnmatch
+  fstat
   glob
+  lstat
   mkdir
+  stat
   strftime
 "
 
--- a/configure.ac	Fri Dec 25 23:58:08 2009 -0500
+++ b/configure.ac	Sat Dec 26 00:07:01 2009 -0500
@@ -1431,14 +1431,14 @@
 ### Checks for functions and variables.
 
 AC_CHECK_FUNCS(atexit basename bcopy bzero canonicalize_file_name \
-  chmod dup2 endgrent endpwent execvp expm1 expm1f fcntl fork fstat getcwd \
+  chmod dup2 endgrent endpwent execvp expm1 expm1f fcntl fork getcwd \
   getegid geteuid getgid getgrent getgrgid getgrnam getpgrp getpid \
   getppid getpwent getpwuid gettimeofday getuid getwd _kbhit kill \
-  lgamma lgammaf lgamma_r lgammaf_r link localtime_r log1p log1pf lstat \
+  lgamma lgammaf lgamma_r lgammaf_r link localtime_r log1p log1pf \
   memmove mkstemp on_exit pipe poll putenv raise readlink \
   realpath rename resolvepath rindex rmdir roundl select setgrent setlocale \
   setpwent setvbuf sigaction siglongjmp sigpending sigprocmask sigsuspend \
-  snprintf stat strcasecmp strdup strerror stricmp strncasecmp \
+  snprintf strcasecmp strdup strerror stricmp strncasecmp \
   strnicmp strptime strsignal symlink tempnam tgammaf trunc umask \
   uname unlink usleep utime vfprintf vsprintf vsnprintf waitpid \
   _chmod _snprintf x_utime _utime32)
--- a/liboctave/ChangeLog	Fri Dec 25 23:58:08 2009 -0500
+++ b/liboctave/ChangeLog	Sat Dec 26 00:07:01 2009 -0500
@@ -1,3 +1,8 @@
+2009-12-26  John W. Eaton  <jwe@octave.org>
+
+	* file-stat.cc (lstat): Delete replacement function.
+	(file_fstat::update_internal): Assume fstat is available.
+
 2009-12-25  John W. Eaton  <jwe@octave.org>
 
 	* file-ops.cc (file_ops::mkdir): Assume we have an mkdir
--- a/liboctave/file-stat.cc	Fri Dec 25 23:58:08 2009 -0500
+++ b/liboctave/file-stat.cc	Sat Dec 26 00:07:01 2009 -0500
@@ -39,14 +39,6 @@
 #include "file-stat.h"
 #include "statdefs.h"
 
-#if !defined (HAVE_LSTAT)
-static inline int
-lstat (const char *name, struct stat *buf)
-{
-  return stat (name, buf);
-}
-#endif
-
 // FIXME -- the is_* and mode_as_string functions are only valid
 // for initialized objects.  If called for an object that is not
 // initialized, they should throw an exception.
@@ -259,8 +251,6 @@
       initialized = false;
       fail = false;
 
-#if defined (HAVE_FSTAT)
-
       struct stat buf;
 
       int status = fstat (fid, &buf);
@@ -298,13 +288,6 @@
 #endif
 	}
 
-#else
-
-      fail = true;
-      errmsg = "fstat not available on this system";
-
-#endif
-
       initialized = true;
     }
 }