Paul Eggert [Tue, 18 Jan 2005 23:52:18 +0000 (23:52 +0000)]
Work around tests/touch/empty-file failure on a system
(sparc64, Linux-2.4.28, glibc-2.3.3) that didn't honor utimes'
NULL-means-set-to-current-time semantics.
Remove temporary file immediately, rather than waiting
for configure's at-exit trap code to do it.
Paul Eggert [Tue, 18 Jan 2005 21:58:11 +0000 (21:58 +0000)]
* modules/chdir-long, modules/openat: New files.
* modules/save-cwd (Depends-on): Depend on chdir-long.
(Makefile.am): Remove lib_SOURCES; now handled by AC_LIBSOURCES.
* lib/save-cwd.c: Include "save-cwd.h" before other include files.
(O_DIRECTORY): Remove; not needed here, since "." must be
a directory. All uses removed.
(save_cwd): Use __sgi || __sun, not sun || __sun. __sun is
universal on Suns, and we also need to test for IRIX.
Revamp code to use 'if' rather than '#if'.
Avoid unnecessary comparison of cwd->desc to 0.
Change the name of the robust chdir function from chdir to chdir_long.
* lib/save-cwd.c: Include chdir-long.h rather than chdir.h.
(restore_cwd): Use chdir_long, not chdir.
* lib/chdir-long.c: Renamed from chdir.c.
* lib/chdir-long.h: Renamed from chdir.h.
[!defined PATH_MAX]: Define chdir_long to chdir on systems like the Hurd.
* m4/chdir-long.m4, openat.m4: New files.
* m4/save-cwd.m4 (gl_SAVE_CWD): Add AC_LIBSOURCES for save-cwd.c,
save-cwd.h. Add AC_LIBOBJ for save-cwd.
Paul Eggert [Tue, 18 Jan 2005 21:09:14 +0000 (21:09 +0000)]
Merge changes from coreutils.
[DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
offsetof() macro construct to avoid compile failure with native HP-UX
11.0 ANSI C compiler.
Jim Meyering [Tue, 4 Jan 2005 20:22:52 +0000 (20:22 +0000)]
Changes imported from coreutils.
(gl_FUNC_MKSTEMP): Rather than using "conftestXXXXXX"
as the mkstemp template, use a temporary directory and an
8.3-friendly template to avoid trouble on systems like DJGPP.
Remove the temporary directory right away, rather than waiting
for configure's at-exit trap code to do it.
Reported by Juan M. Guerrero via Stepan Kasal.
Paul Eggert [Wed, 29 Dec 2004 05:49:08 +0000 (05:49 +0000)]
[!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
not needed. This removes a dependency on the gettext module.
[defined _LIBC]: Do not include <libintl.h>; not needed.
Paul Eggert [Sun, 19 Dec 2004 13:41:34 +0000 (13:41 +0000)]
* alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
Remove now-obsolete comment about AIX.
* getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
(YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
(YYMAXDEPTH): New macro.
Jim Meyering [Fri, 17 Dec 2004 08:12:52 +0000 (08:12 +0000)]
Use `(exit N); exit N', not `(exit N); exit'.
Otherwise, install-sh could exit with improper exit status when
exiting via a trapped interrupt. Thanks to a report from Bob Proulx.
Paul Eggert [Wed, 1 Dec 2004 07:30:05 +0000 (07:30 +0000)]
Don't include <errno.h>,
<sys/param.h>, <time.h>; not needed to establish interface.
(errno): Remove decl.
(HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
(UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
Paul Eggert [Wed, 1 Dec 2004 07:26:53 +0000 (07:26 +0000)]
(is_ENAMETOOLONG): New macro.
(__getcwd.c): Don't restore errno; glibc doesn't.
[HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
first, falling back to our code only if its results look suspicious.
Ensure that the resulting buffer is only as large as necessary.