Commit Graph

3964 Commits

Author SHA1 Message Date
Jim Meyering 8bd2bc6d00 *** empty log message *** 2004-12-05 19:37:56 +00:00
Jim Meyering 334c1b1801 (unit-test): New target.
(check): Depend on it.
(noinst_PROGRAMS): Define.
2004-12-05 19:37:49 +00:00
Jim Meyering ff13a286c7 Test the __fpending function.
This ensures that if there is an error in the definition of the
PENDING_OUTPUT_N_BYTES expression, we'll find about it right away;
that value is used only in the rare event that close_stdout's
fclose fails with EBADF.
2004-12-05 19:28:15 +00:00
Jim Meyering a2b300f156 revert to 1.8, now that we test the offending
condition externally (via new t-fpending.c program)
2004-12-05 19:27:47 +00:00
Jim Meyering 9df080cfc5 *** empty log message *** 2004-12-05 18:53:40 +00:00
Jim Meyering 2edd4a3769 *** empty log message *** 2004-12-05 18:52:37 +00:00
Jim Meyering 210212143b Include <stdlib.h>.
(__fpending): Abort if PENDING_OUTPUT_N_BYTES is negative.
This ensures that if there is an error in the definition of the
PENDING_OUTPUT_N_BYTES expression, we'll find about it right away;
this value is used only in the rare event that close_stdout's
fclose fails with EBADF.
2004-12-05 18:52:33 +00:00
Paul Eggert fcf37d8842 Recent changes to save-cwd, openat. 2004-12-03 07:13:31 +00:00
Paul Eggert f125837030 Import from gnulib. 2004-12-03 07:10:19 +00:00
Paul Eggert dddbfd198a Add copyright and authorship notice.
(AT_FDCWD): Use the same value Solaris 9 uses.
2004-12-03 06:44:30 +00:00
Paul Eggert d2117d918c Include "openat.h" before other include files.
Include "exitfail.h".
(openat): Remove #undef; no longer needed now that we include openat.h first.
(rpl_openat): Add comment about mode_t promotion.  Simplify
code a bit by moving initializations around.  Use exit_failure
rather than EXIT_FAILURE.
2004-12-03 06:43:59 +00:00
Paul Eggert f2173447ba 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.
2004-12-03 06:25:03 +00:00
Paul Eggert a7c9d8dae8 Assume setlocale, locale.h, and localeconv exist and work. 2004-12-02 06:57:05 +00:00
Paul Eggert 08da1bb439 Assume <locale.h> exists.
(human_readable): Assume localeconv exists.
2004-12-02 06:52:10 +00:00
Paul Eggert 2dea4ec8b0 Assume <locale.h> exists.
Include "strdup.h".
(GLIBC_VERSION): New macro.
(hard_locale): Assume setlocale exists.
Rewrite to avoid #ifdef.
Use strdup rather than malloc + strcpy.
2004-12-02 06:51:46 +00:00
Paul Eggert 02496d03b5 * getcwd.c: Use system getcwd first, if appropriate. 2004-12-01 07:13:35 +00:00
Paul Eggert 3b8fa2ba33 (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.
2004-12-01 07:12:14 +00:00
Paul Eggert 52a0364803 Go back to including <sys/types.h> rather than <stddef.h>; this is
needed on OpenBSD since its <utmp.h> needs time_t without making sure
that time_t is defined.
2004-12-01 07:07:38 +00:00
Paul Eggert 525e6c12c3 Make readutmp more consistent among its client code. 2004-11-30 21:41:31 +00:00
Paul Eggert fa60e4cb6f Don't include <sys/types.h>, <errno.h>,
<sys/param.h>, <time.h>; not needed to establish interface.
Include <stddef.h> instead.
(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.
2004-11-30 21:39:46 +00:00
Paul Eggert 8f7cca3d72 Include readutmp.h first.
Include <errno.h>, since readutmp.h no longer does that.
2004-11-30 21:39:26 +00:00
Jim Meyering 943f676c01 . 2004-11-30 14:48:02 +00:00
Jim Meyering e9725a701a renamed to chdir-long.[ch] 2004-11-30 14:47:47 +00:00
Jim Meyering a4304d4187 *** empty log message *** 2004-11-30 14:47:16 +00:00
Jim Meyering de39e47a40 (libfetish_a_SOURCES): Reflect name changes: chdir.[ch] -> chdir-long.[ch] 2004-11-30 14:47:08 +00:00
Jim Meyering e7acb8d8dd Include chdir-long.h rather than chdir.h.
(restore_cwd): Use chdir_long, not chdir.
2004-11-30 14:46:25 +00:00
Jim Meyering 34a8030d36 *** empty log message *** 2004-11-30 14:46:09 +00:00
Jim Meyering 8f3175736e [!defined PATH_MAX]: Define chdir_long to chdir on systems like the Hurd. 2004-11-30 14:45:28 +00:00
Jim Meyering 86c716db61 Renamed from chdir.h. 2004-11-30 14:35:46 +00:00
Jim Meyering 036728c2e8 Renamed from chdir.c. 2004-11-30 14:35:33 +00:00
Jim Meyering 2a807da972 *** empty log message *** 2004-11-30 14:24:55 +00:00
Jim Meyering d70691fc4b (O_DIRECTORY): Define, if necessary.
(memchrcspn): Tiny wrapper around memchr.
(rpl_chdir): Use memchrcspn rather than strcspn.
2004-11-30 14:24:40 +00:00
Jim Meyering f76c6fa030 *** empty log message *** 2004-11-28 22:43:11 +00:00
Jim Meyering 98be5b6685 (rpl_openat): Also accept optional mode parameter.
Adjust prototype
2004-11-28 22:42:08 +00:00
Jim Meyering 26b53ffffe (rpl_openat): Also accept optional mode parameter. 2004-11-28 22:41:57 +00:00
Jim Meyering fd6af25d9a Don't let error uses in #if-0'd code trigger `make distcheck' failure. 2004-11-28 22:24:38 +00:00
Jim Meyering c272386d5d (main): Appease the gods. 2004-11-28 21:29:16 +00:00
Jim Meyering b69fc7b949 *** empty log message *** 2004-11-28 21:13:59 +00:00
Jim Meyering bb4833e756 *** empty log message *** 2004-11-28 21:03:13 +00:00
Jim Meyering f039b8f8bf Include "chdir.h", so that if save_cwd/getcwd
saves a name longer than PATH_MAX, restore_cwd's chdir can use it.
2004-11-28 21:03:08 +00:00
Jim Meyering a67e741070 . 2004-11-28 20:52:04 +00:00
Jim Meyering 77eb2b6b8a *** empty log message *** 2004-11-28 20:51:57 +00:00
Jim Meyering d91b876d72 (libfetish_a_SOURCES): Add chdir.h and openat.h. 2004-11-28 20:51:46 +00:00
Jim Meyering fa871415f9 *** empty log message *** 2004-11-28 20:51:05 +00:00
Jim Meyering 79e2f2c1f9 *** empty log message *** 2004-11-28 20:50:26 +00:00
Jim Meyering 30df68dfe2 This is a robust version of chdir, in that it can handle directory
names longer than PATH_MAX.
2004-11-28 20:49:14 +00:00
Jim Meyering c373cdcf61 add another FIXME, to make it obvious 2004-11-28 20:49:04 +00:00
Jim Meyering 72287ac271 This is a robust version of chdir, in that it can handle directory
names longer than PATH_MAX.
2004-11-28 20:48:29 +00:00
Paul Eggert 6942c45d50 Regenerate. 2004-11-26 08:11:52 +00:00
Paul Eggert 03a690ddca Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
HP's ANSI C compiler.
2004-11-26 07:40:56 +00:00