[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0
From: |
Jim Meyering |
Subject: |
[bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0 |
Date: |
Wed, 09 Mar 2005 09:04:48 +0100 |
Here's a patch that should restore the ability of save-cwd to
work on systems without the fchdir function.
Would you please see if this is sufficient?
If so, I'll check it in to gnulib (with an AC_CHECK_FUNCS(fchdir)
in save-cwd.m4).
Index: save-cwd.c
===================================================================
RCS file: /fetish/cu/lib/save-cwd.c,v
retrieving revision 1.24
diff -u -p -r1.24 save-cwd.c
--- save-cwd.c 20 Jan 2005 22:17:26 -0000 1.24
+++ save-cwd.c 9 Mar 2005 07:49:19 -0000
@@ -44,6 +44,18 @@
#include "chdir-long.h"
#include "xgetcwd.h"
+/* On systems without the fchdir function (WOE), pretend that open
+ always returns -1 so that save_cwd resorts to using xgetcwd.
+ Since chdir_long requires fchdir, use chdir instead. */
+#if !HAVE_FCHDIR
+# undef open
+# define open(File, Flags) -1
+# undef fchdir
+# define fchdir(Fd) abort ()
+# undef chdir_long
+# define chdir_long(Dir) chdir (Dir)
+#endif
+
/* Record the location of the current working directory in CWD so that
the program may change to other directories and later use restore_cwd
to return to the recorded location. This function may allocate
- [bug-gnulib] RE: GNULib save-cwd.c on Windows & Visual Studio 6.0, Jim.Hyslop, 2005/03/09
- [bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0, Derek Price, 2005/03/08
- [bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0, Jim Meyering, 2005/03/08
- [bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0, Derek Price, 2005/03/08
- [bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0,
Jim Meyering <=
- [bug-gnulib] RE: GNULib save-cwd.c on Windows & Visual Studio 6.0, Conrad T. Pino, 2005/03/09
- [bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0, Jim Meyering, 2005/03/09
- [bug-gnulib] RE: GNULib save-cwd.c on Windows & Visual Studio 6.0, Conrad T. Pino, 2005/03/09
- [bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0, Jim Meyering, 2005/03/10
- [bug-gnulib] RE: GNULib save-cwd.c on Windows & Visual Studio 6.0, Conrad T. Pino, 2005/03/09
[bug-gnulib] Re: GNULib save-cwd.c on Windows & Visual Studio 6.0, Frank Hemer, 2005/03/09
Re: [bug-gnulib] RE: GNULib save-cwd.c on Windows & Visual Studio 6.0, James Youngman, 2005/03/09