Commit Graph

4979 Commits

Author SHA1 Message Date
Paul Eggert
6870eeeaff (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
AT_FDCWD exceeds INT_MAX.
2006-02-21 06:42:29 +00:00
Jim Meyering
3f7e0c2173 . 2006-02-20 13:00:54 +00:00
Jim Meyering
74699a2b52 *** empty log message *** 2006-02-16 23:10:27 +00:00
Jim Meyering
1ec610ba19 Include lstat.h, so that uses of lstat are converted
to uses of rpl_lstat, e.g., on Solaris 9.  Otherwise, programs like
du (which now uses the openat-enabled fts and hence fstatat) would
mistakenly fail to dereference a symlink-to-directory specified
with a trailing slash.
2006-02-16 23:10:01 +00:00
Paul Eggert
05e61daca4 Sync from gnulib. 2006-02-14 23:08:59 +00:00
Paul Eggert
de107e9110 Fix typo in previous checkin: I deleted a '2' by mistake. 2006-02-11 00:36:08 +00:00
Paul Eggert
b455780a19 (close_stdout): Don't assume 'bool' converts nonzero
ints to 0 or 1, as this isn't true for the stdbool.h substitute.
2006-02-08 00:08:38 +00:00
Jim Meyering
9a8fc54523 *** empty log message *** 2006-02-02 21:25:10 +00:00
Jim Meyering
b88d20f978 Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
failure on deficient systems, and simplify gnulib lgpl dependencies.

(rpl_lstat): Rewrite to use stat() in place of the
xmalloc/lstat combination.  Based on a patch from Bruno Haible.
2006-02-02 21:25:06 +00:00
Paul Eggert
32aba5ac50 (L_): Renamed from L. All uses changed. 2006-01-27 18:41:50 +00:00
Paul Eggert
da953b9d22 Sync stdbool from gnulib. 2006-01-26 21:01:56 +00:00
Paul Eggert
a768b3ebec Merge stdbool from gnulib; we're still not quite there yet. 2006-01-25 18:32:46 +00:00
Paul Eggert
1a9e9d670d (true, false) [defined __BEOS__]: undef, as before.
(_Bool) [!@HAVE__BOOL@ && defined __GNUC__]: Use an enum
rather than a #define.
2006-01-25 18:32:19 +00:00
Jim Meyering
e2c3daca96 . 2006-01-25 08:05:45 +00:00
Jim Meyering
292e0cdfa6 Remove useless parentheses in cpp directive. 2006-01-25 07:44:28 +00:00
Jim Meyering
0a42446129 *** empty log message *** 2006-01-25 07:43:20 +00:00
Jim Meyering
d433382eaa Remove useless parentheses in cpp directive. 2006-01-25 07:43:17 +00:00
Paul Eggert
a30a9a3ec4 Import from gnulib. 2006-01-24 07:52:03 +00:00
Jim Meyering
4cf7d77126 *** empty log message *** 2006-01-23 15:06:42 +00:00
Jim Meyering
e17e330140 Remove unused definition of N_. 2006-01-23 15:06:37 +00:00
Paul Eggert
7c364b54fc (quotearg_buffer_restyled): Add "default: break;"
to pacify gcc -Wswitch-default.
2006-01-22 08:46:54 +00:00
Jim Meyering
3173cb27dd . 2006-01-21 11:17:19 +00:00
Jim Meyering
d55e2d8528 (openat_needs_fchdir): New function. 2006-01-17 17:43:10 +00:00
Jim Meyering
88df081621 *** empty log message *** 2006-01-17 17:42:57 +00:00
Jim Meyering
264f1bc3cd (openat_needs_fchdir): Declare it. 2006-01-17 17:42:53 +00:00
Jim Meyering
e9f0c42afc *** empty log message *** 2006-01-17 17:24:38 +00:00
Jim Meyering
a28b096d7f [struct FTS] (fts_cwd_fd): New member.
[struct FTS] (fts_rft): Remove now-unused member.
[struct FTS] (fts_cycle.state): Improve comment.
2006-01-17 17:24:29 +00:00
Jim Meyering
c1994c16c2 Rewrite fts.c not to change the current working directory,
by using openat, fstatat, fdopendir, etc..

[! _LIBC]: Include "openat.h" and "unistd--.h".
(HAVE_OPENAT_SUPPORT): Define.
[_LIBC] (fchdir): Don't undef or define; no longer used.
(FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
Now, this `function' always succeeds, and consumes its file descriptor
parameter -- so callers must not close such FDs.  Update callers.
(diropen_fd, opendirat, cwd_advance_fd): New functions.
(diropen): Add parameter, SP.  Adjust all callers.
Implement using diropen_fd, rather than open.
(fts_open): Initialize new member, fts_cwd_fd.
Remove fts_rft-setting code.
(fts_close): Close fts_cwd_fd, if necessary.
(__opendir2): Define in terms of opendir or opendirat,
depending on whether the FST_NOCHDIR flag is set.
(fts_build): Since fts_safe_changedir consumes its FD, and since
this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
and close the dup'd file descriptor upon failure.
(fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
(fts_safe_changedir): Tweak semantics to reflect that this function
now calls cwd_advance_fd and hence consumes its FD argument.
2006-01-17 17:24:14 +00:00
Jim Meyering
7dabfc7e73 . 2006-01-12 08:40:34 +00:00
Jim Meyering
c27afc1a04 *** empty log message *** 2006-01-12 07:55:40 +00:00
Jim Meyering
b78b7818af Remove useless parentheses in cpp directives, so that
this file passes coreutils' `make syntax-check' tests.
2006-01-12 07:55:36 +00:00
Paul Eggert
9b6eae76de Import from gnulib. 2006-01-12 07:21:34 +00:00
Paul Eggert
ea58c1150c Add stdint_.h. 2006-01-12 07:21:19 +00:00
Paul Eggert
518d041db8 Adjust to md5 changes in gnulib, and make sha1 etc. more consistent
with md5.
2006-01-12 07:19:50 +00:00
Paul Eggert
3f83336726 (struct sha512_ctx): Use a word buffer, not a byte buffer, so that we
don't need to worry about alignment.
2006-01-12 07:18:39 +00:00
Paul Eggert
a60af3a64f (struct sha256_ctx): Use a word buffer, not a byte buffer, so that we
don't need to worry about alignment.  All uses changed.
2006-01-12 07:18:13 +00:00
Paul Eggert
25962cd489 (struct sha1_ctx): Use a word buffer, not a byte buffer,
so that we don't need to worry about alignment.  All uses changed.
This merges the 2005-10-28 md5 change into sha1.
2006-01-12 07:17:51 +00:00
Paul Eggert
1834ba06ac Fix commentary to match md5 better. Adjust to .h file changes. 2006-01-12 07:17:25 +00:00
Paul Eggert
3024d13d7e (__attribute__): Remove; unused. 2006-01-12 07:16:33 +00:00
Paul Eggert
7354a360be Fix commentary typos.
(alignof, UNALIGNED_P): No need for a GCC-specific version.
2006-01-12 07:16:21 +00:00
Paul Eggert
71b4960878 (BUILT_SOURCES, EXTRA_DIST, stdint.h, MOSTLYCLEANFILES):
Add gnulib snippet.
2006-01-12 07:16:07 +00:00
Paul Eggert
aa038250c3 Add stdint.h. 2006-01-12 07:15:48 +00:00
Jim Meyering
4eafb9d163 *** empty log message *** 2006-01-11 22:11:49 +00:00
Jim Meyering
50114df430 *** empty log message *** 2006-01-11 21:32:56 +00:00
Jim Meyering
108b46760a *** empty log message *** 2006-01-11 21:00:42 +00:00
Jim Meyering
cf6281916b (fts_stat): When following a symlink-to-directory,
don't interpret all stat-fails+lstat-succeeds as indicating a
dangling symlink.  That can also happen at least for ELOOP.
The fix: return FTS_SLNONE only when the stat errno is ENOENT.
2006-01-11 21:00:36 +00:00
Jim Meyering
f9574570b3 *** empty log message *** 2006-01-11 16:30:08 +00:00
Jim Meyering
08e4a9a00e (fts_open): Put new (2006-01-04) maxarglen declaration and uses in their
own block, so pre-c99 compilers don't object.
2006-01-11 16:29:35 +00:00
Jim Meyering
f84dc6ccfc *** empty log message *** 2006-01-11 16:19:06 +00:00
Jim Meyering
614235c849 [!_LIBC]: Include "fcntl--.h", to map open to open_safer. 2006-01-11 16:18:39 +00:00
Jim Meyering
dc9da6bde0 *** empty log message *** 2006-01-11 13:33:03 +00:00
Jim Meyering
0e42486491 (fchmodat, fchownat): Declare.
(chmodat, lchmodat): Define convenience functions.
(chownat, lchownat): Likewise.
2006-01-11 13:32:47 +00:00
Jim Meyering
9cbd6c0366 (fchownat): New function. 2006-01-11 13:32:03 +00:00
Jim Meyering
c6749127ca (fchmodat): New file and function. 2006-01-11 13:30:31 +00:00
Jim Meyering
06df842f61 *** empty log message *** 2006-01-11 10:07:22 +00:00
Jim Meyering
d1fe298155 (OP): Remove useless space-before-TAB. 2006-01-11 10:07:13 +00:00
Paul Eggert
e06993903e Sync from gnulib. 2006-01-10 20:13:35 +00:00
Paul Eggert
388f158acf Update copyright year. 2006-01-10 20:05:53 +00:00
Paul Eggert
00eeaec5f2 Remove stray "lib/"s in previous change. 2006-01-10 20:01:34 +00:00
Paul Eggert
d11af4159e Sync from gnulib. 2006-01-10 17:47:56 +00:00
Jim Meyering
71520b31c0 *** empty log message *** 2006-01-10 11:55:20 +00:00
Jim Meyering
58e925ce5f Avoid the double-free (first in fts_read, second in fts_close) that
would occur when an `active' directory is made inaccessible (e.g.,
via chmod a-x) during a traversal.

(fts_read): After a failed fchdir, update sp->fts_cur
before returning.  Reproduce this failure by
mkdir -p a/b; cd a; chmod a-x . b
Reported by Stavros Passas.
2006-01-10 11:55:13 +00:00
Jim Meyering
e774de2be6 *** empty log message *** 2006-01-10 10:23:27 +00:00
Jim Meyering
0cb6f1cc82 fix typo in comment 2006-01-09 20:32:08 +00:00
Jim Meyering
00d069f7d9 *** empty log message *** 2006-01-06 16:48:27 +00:00
Jim Meyering
ea20facd90 (COPYRIGHT_YEAR): Update to 2006. 2006-01-06 16:48:24 +00:00
Jim Meyering
084903a2b1 . 2006-01-04 21:06:39 +00:00
Paul Eggert
15954c3753 (tzname): Don't declare if it is already #defined. 2006-01-04 18:57:24 +00:00
Jim Meyering
0aea37a1b3 *** empty log message *** 2006-01-04 07:13:10 +00:00
Jim Meyering
27ab46340c Merge from glibc.
(fts_open): Avoid function call in MAX macro use.
2006-01-04 07:12:22 +00:00
Paul Eggert
a2fa57b24c (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
long int, not int, for nanosecond counts, so that people who are
used to POSIX struct timespec won't be surprised.
2006-01-03 23:21:38 +00:00
Jim Meyering
b9c62b6747 correct first-line comment 2006-01-03 10:29:58 +00:00
Paul Eggert
c0dac69808 New approach to safer chmod. 2006-01-02 07:30:27 +00:00
Paul Eggert
bee93bd060 No longer used. 2006-01-02 07:18:30 +00:00
Paul Eggert
e59703a1d6 New file. 2006-01-02 06:34:32 +00:00
Paul Eggert
c225633528 Include lchmod.h, lchmod.c.
(make_dir_parents): Use lchown rather than chown, and
lchmod rather than chmod.
2006-01-02 06:33:12 +00:00
Paul Eggert
eb330d2584 chdir-related fixes 2005-12-27 08:00:42 +00:00
Paul Eggert
97fe820f88 (save_cwd): Don't bother trying to open directory
for write access: POSIX says that must fail.
2005-12-27 07:57:14 +00:00
Paul Eggert
ee7334652f (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
Fall back on chown if open failed with EACCES.
2005-12-27 07:56:33 +00:00
Paul Eggert
0d7468cabd (defined_S_IFMT): New macro.
Include stat-macros.h.
Include stdlib.h, for abort().
Don't include stdio.h or assert.h; no longer needed.
(same_file_type): Don't assume S_IFMT is defined, as POSIX
does not require this.  Don't assume S_IFCHR and S_IFBLK have
their usual sort of bit pattern.
(fchmod_new): Open with O_NOCTTY for as well, for minor
improvement on hosts where that matters.  Don't bother to assert,
since the caller (in this source file) checks the same thing.
Discard any errno from a close failure, for consistency with other
code.
2005-12-27 07:55:50 +00:00
Paul Eggert
cc4d59e9cd (diropen): Don't bother trying to open directory for write access:
POSIX says that must fail.
2005-12-27 07:55:03 +00:00
Paul Eggert
8846a6bfdd (chdir_no_follow): Don't bother trying to open directory for write
access: POSIX says that must fail.
2005-12-27 07:54:37 +00:00
Paul Eggert
a2c8ec26a4 (cdb_free): Don't bother trying to open directory
for write access: POSIX says that must fail.
(cdb_free): Open with O_NOCTTY | O_NONBLOCK as
well, for minor improvements on hosts that lack O_DIRECTORY.
2005-12-27 07:53:50 +00:00
Jim Meyering
edf69af317 (chdir_no_follow): Move declaration of local,
sb2, `down' into the scope where it is used.
Note that on some systems this function also fails when DIR
is a writable-yet-unreadable directory.
2005-12-26 18:53:58 +00:00
Jim Meyering
078800a00b *** empty log message *** 2005-12-26 18:53:46 +00:00
Paul Eggert
7cffc5f20e chdir-safer.c still needs unistd.h 2005-12-25 21:40:01 +00:00
Paul Eggert
f7a0d07623 Whoops; don't remove the include for unistd.h, since it defines fchdir. 2005-12-25 21:38:43 +00:00
Paul Eggert
11eedd84d3 chdir-safer cleanup 2005-12-25 21:35:51 +00:00
Paul Eggert
8b9f6b163a (chdir_no_follow): Don't include stdio.h, assert.h,
unistd.h, fcntl--.h; not needed.
(O_DIRECTORY): Define if not already defined.
(chdir_no_follow): Revamp describing comment to match code more
closely.  Redo use of internal vars to avoid lint complaints.
Work even if directory is writeable but not readable.
Open with O_DIRECTORY | O_NOCTTY, for benefit of hosts that
don't have O_NOFOLLOW.  Use O_NONBLOCK (POSIX spelling) rather
than O_NDELAY.  Don't bother invoking fstat if open does not
dereference symlink, since the result isn't used then.
Don't assume file descriptor is positive; it might be zero
now that we no longer include fcntl--.h (we don't need fcntl--.h
since we immediately close the descriptor).
2005-12-25 21:35:38 +00:00
Paul Eggert
532cf2ac33 (FCHMOD_SAFER_H): Remove: it was misnamed, and wasn't needed anyay. 2005-12-25 21:35:21 +00:00
Jim Meyering
735fb62c0f *** empty log message *** 2005-12-25 17:34:04 +00:00
Jim Meyering
d789e78a75 (chdir_no_follow): Remove unnecessary test of S_ISDIR (sb_init.st_mode). 2005-12-25 17:33:57 +00:00
Jim Meyering
7916560259 *** empty log message *** 2005-12-23 18:15:38 +00:00
Jim Meyering
5d3118175f (make_dir_parents): Use chdir_no_follow only
if we've just created the directory.
2005-12-23 18:15:33 +00:00
Jim Meyering
bdf801ef29 *** empty log message *** 2005-12-23 17:14:37 +00:00
Jim Meyering
7616f9171a *** empty log message *** 2005-12-23 12:00:37 +00:00
Jim Meyering
2eab9d93fc (chdir_no_follow): Rewrite to use fchdir even
when O_NOFOLLOW is not defined.  Suggested by Eric Blake.
2005-12-23 12:00:26 +00:00
Jim Meyering
867dbd1591 *** empty log message *** 2005-12-23 08:28:19 +00:00
Jim Meyering
bd80c2e5a7 (O_NOFOLLOW): Define, if necessary. 2005-12-23 08:28:14 +00:00
Jim Meyering
6ed15904b1 (O_NOFOLLOW): Define. 2005-12-23 08:27:44 +00:00
Jim Meyering
2bd65173c2 *** empty log message *** 2005-12-22 14:36:22 +00:00
Jim Meyering
b6c621211b Include "fcntl--.h" and "unistd--.h", to map open
and dup to open_safer and dup_safer, respectively.
(openat_permissive): Fix typo in comment.
2005-12-22 14:34:20 +00:00
Jim Meyering
1e1938032b . 2005-12-21 10:23:51 +00:00
Jim Meyering
05eb4556c8 . 2005-12-21 09:48:41 +00:00
Jim Meyering
a7c7b483f1 *** empty log message *** 2005-12-21 09:43:44 +00:00
Jim Meyering
2956eb272c like chdir(2), but safer, if possible 2005-12-21 09:42:36 +00:00
Jim Meyering
3108671902 *** empty log message *** 2005-12-20 14:23:25 +00:00
Jim Meyering
d0344cfc55 (RW_USR): Remove definition.
(make_dir_parents): Use S_IRWXU, now that read access is also required.

Avoid a race condition, on systems where open honors O_NOFOLLOW.

(make_dir_parents): Include chdir-safer.h.
Use chdir_no_follow in place of chdir.
2005-12-20 14:23:20 +00:00
Jim Meyering
0b7757fac4 *** empty log message *** 2005-12-20 10:28:58 +00:00
Jim Meyering
cf02d3c6f6 (make_dir_parents): Remove unnecessary casts of alloca,
since now it's guaranteed to be (void *).
2005-12-20 10:28:53 +00:00
Jim Meyering
ddb24aa9fb *** empty log message *** 2005-12-20 10:24:43 +00:00
Jim Meyering
7be64dd68f (fchmod_new): Don't try to close fd if it's < 0. 2005-12-20 10:24:37 +00:00
Jim Meyering
e0029290b8 . 2005-12-19 18:13:00 +00:00
Jim Meyering
89276658f2 . 2005-12-19 18:12:30 +00:00
Jim Meyering
c99e1d2cb6 . 2005-12-17 10:48:30 +00:00
Jim Meyering
c4a1355047 *** empty log message *** 2005-12-17 10:48:12 +00:00
Jim Meyering
4a12f5ebcf (acl_entries): Add fallback implementation for POSIX ACL
systems other than Linux.
(chmod_or_fchmod): New function: use fchmod when possible,
and chmod otherwise.
(file_has_acl): Add a POSIX ACL implementation, with a
Linux-specific subcase.
(copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
S_ISVTX from one file to another.  Fall back to fchmod/chmod when
acls are unsupported.
(set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
are unsupported.
2005-12-17 10:31:33 +00:00
Jim Meyering
9566c9c9d3 (copy_acl, set_acl): Add declarations. 2005-12-17 10:31:15 +00:00
Paul Eggert
1833362111 remove/openat cleanup 2005-12-17 06:56:19 +00:00
Paul Eggert
3f86aaadcf Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
"gettext.h"; either no longer needed or are guaranteed by openat.h.
(_): Remove; no longer needed.
(openat): Renamed from rpl_openat; no need for rpl_openat
since openat.h renames openat for us.
Replace most of the body with a call to openat_permissive,
to avoid duplicate code.
Port to (probably hypothetical) environments were mode_t is
wider than int.
(openat_permissive): Require mode arg, so that we can check
types better.  Put it just after flags.  Change cwd failure
indicator from pointer-to-bool to pointer-to-errno-value.
All callers changed.
Invoke openat_save_fail and/or openat_restore_fail if
cwd_errno is null, so that openat can call us.
(openat_permissive, fdopendir, fstatat, unlinkat):
Simplify errno handling to avoid some duplicate code,
as it's OK to set errno on success.
2005-12-17 06:55:32 +00:00
Paul Eggert
1c5cebe703 Revamp code so that function macros depend on
__OPENAT_PREFIX only, not also on AT_FDCWD.
(openat_ro): Remove.  Caller changed to use openat_permissive.
(openat_permissive): Now a macro, if not a function.
(openat_restore_fail, openat_save_fail): Now always functions,
since mkdirat needs them even if __OPENAT_PREFIX is defined.
2005-12-17 06:55:01 +00:00
Jim Meyering
049a807bc6 . 2005-12-15 14:47:36 +00:00
Jim Meyering
b0cee61e23 *** empty log message *** 2005-12-14 20:37:24 +00:00
Jim Meyering
bd78a76886 (libcoreutils_a_SOURCES): Remove fprintftime.c
and fprintftime.h.  Now they're pulled in via the .m4 file.
2005-12-14 20:37:06 +00:00
Paul Eggert
23b2b5c660 * Makefile.am (stdbool.h): Resurrect the 'sed' that goes along
with '#if !@HAVE_BOOL@".
2005-12-14 00:09:23 +00:00
Paul Eggert
a6caba2509 (stdbool.h): Resurrect the 'sed' that goes along with '#if !@HAVE_BOOL@". 2005-12-14 00:08:54 +00:00
Paul Eggert
4170c66d45 (_Bool): Resurrect the "#if !@HAVE__BOOL@" check, to
work around compilers that have a (possibly-broken) _Bool but lack
a working <stdbool.h>.
2005-12-13 19:42:27 +00:00
Paul Eggert
5ea987eade * lib/stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
porting problem reported by Georg Schwarz in
<http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
* m4/stat-time.m4 (gl_STAT_TIME): Likewise.
2005-12-07 18:22:05 +00:00
Paul Eggert
19af464ef3 Mention reporters for "none" and "proc" mounts. 2005-12-05 17:46:22 +00:00
Jim Meyering
5e36a5a28f *** empty log message *** 2005-12-04 22:00:18 +00:00
Jim Meyering
6a33c69c49 (EXPECTED_ERRNO): Add ENOSYS, for Solaris 8.
Paul Eggert reported that unlink/rmdir vs. e.g., /proc/self/fd/N/FILE
fails with ENOSYS.  This makes openat revert to using save-cwd.c
functions in that case.
2005-12-04 22:00:14 +00:00
Jim Meyering
b3e300393e . 2005-12-03 23:19:58 +00:00
Jim Meyering
e4f62b9fcf *** empty log message *** 2005-12-02 07:49:12 +00:00
Paul Eggert
76bebf24a5 Import from gnulib. 2005-12-02 00:42:52 +00:00
Jim Meyering
46679371cb *** empty log message *** 2005-11-30 13:05:08 +00:00
Jim Meyering
798f577bec Include openat-priv.h.
Remove definitions of macros defined therein.
2005-11-30 13:04:26 +00:00
Jim Meyering
07c80bab50 Define macros used by mkdirat.c and openat.c. 2005-11-30 13:03:21 +00:00
Jim Meyering
48a8638c23 *** empty log message *** 2005-11-30 12:40:12 +00:00
Jim Meyering
29a3f2f810 (mkdirat): Declare. 2005-11-30 12:40:09 +00:00
Jim Meyering
3f23bf599c *** empty log message *** 2005-11-30 12:39:30 +00:00
Jim Meyering
2e72b76fd3 (mkdirat): New file and function. 2005-11-30 12:39:14 +00:00
Paul Eggert
fc0fa751c4 Log today's changes. 2005-11-26 07:53:39 +00:00
Paul Eggert
1e20020bb8 (ME_DUMMY): "none" and "proc" file systems are dummies
too.
2005-11-26 07:52:11 +00:00
Paul Eggert
45ad3543a9 Include <limits.h>.
(dev_from_mount_options)
[defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
New function.  It no longer assumes "dev=" has the System V meaning
on Linux (since it doesn't).  It also parses "dev=" more carefully.
(read_file_system_list)
[defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
dev= in that case.
2005-11-26 07:43:50 +00:00
Paul Eggert
128bc21842 (MOSTLYCLEANFILES): Clean stdbool.h-t, not stdbool.ht. 2005-11-26 06:58:34 +00:00
Paul Eggert
b7fa297fa5 (stdbool.h): Fix typo in previous change. 2005-11-26 06:55:22 +00:00
Paul Eggert
dedcfff69c (stdbool.h): Just copy stdbool_.h; no need to sed any more. 2005-11-26 06:54:17 +00:00
Paul Eggert
6771c1b415 Simplify greatly, under the assumption that these
days most people use C99-compatible compilers to debug, so it's
not worth worrying about catering to older compilers for that.
This works around some porting problems with HP-UX compilers.
(false, true) [defined __BEOS__]: Don't #undef; no longer needed.
(_Bool): typedef to bool if C++ or BeOS, and #define to signed char
otherwise.
2005-11-26 06:37:31 +00:00
Paul Eggert
c63680e87b (gettime) [!defined OK_TO_USE_1S_CLOCK]:
Report an error at compile-time if only a 1-second nominal clock
resolution is found.
2005-11-26 06:30:35 +00:00
Paul Eggert
757d7a8eb5 Add buffer-lcm. 2005-11-24 06:49:10 +00:00
Paul Eggert
ef774a082b (libcoreutils_a_SOURCES): Add buffer-lcm.c, buffer-lcm.h. 2005-11-24 06:48:55 +00:00
Paul Eggert
79eb35c4e5 Initial version 2005-11-24 06:48:36 +00:00
Paul Eggert
325619eb0d Initial version, from diffutils 2005-11-24 06:48:03 +00:00
Jim Meyering
1aab378857 tweak grammar in comments 2005-11-23 13:36:48 +00:00
Jim Meyering
694b9b330a *** empty log message *** 2005-11-23 13:35:15 +00:00
Jim Meyering
e8609798de (fdopendir): Don't change errno when returning non-NULL. 2005-11-23 13:35:09 +00:00
Jim Meyering
66878248f6 . 2005-11-22 15:33:39 +00:00
Jim Meyering
9c14365b2a *** empty log message *** 2005-11-22 14:53:55 +00:00
Jim Meyering
d591c30293 (openat_permissive): Declare.
(openat_ro): Define.
2005-11-22 14:53:47 +00:00
Jim Meyering
2fa54245e1 (EXPECTED_ERRNO): New macro.
(openat_permissive): New function -- used in remove.c rewrite.
(all functions): Set errno just before returning, only if there
was an actual failure.
Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
2005-11-22 14:52:48 +00:00
Jim Meyering
75e3f2ecf2 *** empty log message *** 2005-11-20 09:10:35 +00:00
Jim Meyering
800af65fec . 2005-11-20 08:52:08 +00:00
Jim Meyering
18673b9f2d *** empty log message *** 2005-11-20 08:51:38 +00:00
Jim Meyering
e88132fa06 New file, mostly from euidaccess.c. 2005-11-20 08:51:10 +00:00
Jim Meyering
a1343d67f2 tweak grammar in a comment 2005-11-19 07:49:10 +00:00
Paul Eggert
8645d522c0 Don't bother with #pragma STDC FENV_ACCESS ON, as
coreutils no longer futzes with rounding modes.
2005-11-15 18:30:28 +00:00
Jim Meyering
db5eb389ad Use #if !, not #ifndef, for AC_CHECK_DECLS. 2005-11-14 14:51:24 +00:00
Jim Meyering
6b869921fa *** empty log message *** 2005-11-14 14:51:21 +00:00
Jim Meyering
13e06b3243 *** empty log message *** 2005-11-13 14:07:11 +00:00
Jim Meyering
dcd8aa97f2 Include <config.h>, required for possible replacement of mkstemp. 2005-11-13 14:07:06 +00:00
Jim Meyering
3fd87d8e73 *** empty log message *** 2005-11-12 10:16:50 +00:00
Jim Meyering
716377a20a *** empty log message *** 2005-11-12 10:06:34 +00:00
Jim Meyering
108429b83f Emulate openat-family functions using Linux's procfs, if possible.
Idea and some code from Ulrich Drepper's glibc changes.

(BUILD_PROC_NAME): New macro.
Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
(rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
before falling back on save_cwd and restore_cwd.
(fdopendir, fstatat, unlinkat): Likewise.
2005-11-12 10:06:29 +00:00
Jim Meyering
7fdc7d4df9 *** empty log message *** 2005-11-10 23:20:09 +00:00
Jim Meyering
e5475103aa (fstatat, unlinkat): Perform the syscall directly,
skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
2005-11-10 23:20:05 +00:00
Paul Eggert
9d9e6430a3 Fix comment 2005-11-10 20:20:31 +00:00
Paul Eggert
163141255f Include "timespec.h" rather than the sys/time / time
business.
(gethrxtime) [! (HAVE_NANOUPTIME
|| (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
|| HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
our own approximation.
2005-11-10 20:20:20 +00:00
Paul Eggert
14f7ef9d17 gethrxtime now uses gettime 2005-11-10 20:20:02 +00:00
Jim Meyering
aad084f10f Use /dev/full if possible for descriptor 0 -- like glibc now does.
Fall back on /dev/null if opening /dev/full fails.
2005-11-09 20:53:41 +00:00
Paul Eggert
4b15886f93 "touch 0101000000" now operates as POSIX 1002.1-2001 requires. 2005-11-01 23:43:38 +00:00
Paul Eggert
71fa8dc28e (PDS_PRE_2000): New macro. 2005-11-01 23:42:16 +00:00
Paul Eggert
1a0a832ac8 (year): Arg is now syntax_bits rather than allow_century.
All usages changed.  Reject dates outside the range 1969-1999 if
PDS_PRE_2000 is used.
2005-11-01 23:41:56 +00:00
Paul Eggert
a54170c2a0 Fix porting problems reported by Theodoros V. Kalamatianos. 2005-10-30 21:46:00 +00:00
Paul Eggert
9c9083d9a7 [defined HAVE_CONFIG_H]: Include <config.h>, so that large files can be opened. 2005-10-30 21:44:31 +00:00
Paul Eggert
9fb982e150 (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
Don't assume that futimes failing means we must fail.
2005-10-30 21:32:02 +00:00
Paul Eggert
b90c07efd8 (__getcwd): Don't assume that system calls after readdir
leave errno alone.  Problem reported by Dmitry V. Levin.
2005-10-30 01:31:32 +00:00
Paul Eggert
5648577df0 (savedir): Don't assume that xrealloc etc. leave errno alone. 2005-10-28 23:06:42 +00:00
Jim Meyering
e928445598 *** empty log message *** 2005-10-24 13:36:03 +00:00
Jim Meyering
e8871a9516 (make_dir_parents): Like the code above it, don't rely
on mkdir failing with a particular errno value (EEXIST).
Based on a patch by Dmitry V. Levin.
2005-10-24 13:35:59 +00:00
Jim Meyering
d038ef379e *** empty log message *** 2005-10-24 10:22:19 +00:00
Jim Meyering
b8cedd257a (make_dir_parents): Make the preceding fix a little
more robust, e.g., when the final component is created as a non-
directory by another process just before `mkdir -p's final mkdir.
2005-10-24 10:22:10 +00:00
Jim Meyering
946e7dc930 *** empty log message *** 2005-10-24 10:03:51 +00:00
Jim Meyering
5b427ce7c3 A command like `mkdir -p nonexistent/.' would create the
directory but exit nonzero with a diagnostic.  This could also be
triggered with a non-`.' component, e.g., in a race with another
process running the same `mkdir -p nonexistent/sub' command.

(make_dir_parents): Handle the case of an existing final component.
Reported by Matthias Andree here:
http://savannah.gnu.org/bugs/?func=detailitem&item_id=14848
2005-10-24 10:03:47 +00:00
Jim Meyering
708c4e6682 . 2005-10-23 16:00:59 +00:00
Jim Meyering
f0b2494fa6 *** empty log message *** 2005-10-23 15:59:09 +00:00
Jim Meyering
441c8bd865 from David Madore 2005-10-23 15:58:59 +00:00
Jim Meyering
00ba9322af Remove no-longer-relevant comment. 2005-10-23 15:55:30 +00:00
Jim Meyering
e2cfa48b0f from David Madore 2005-10-23 15:53:55 +00:00
Jim Meyering
1e12a6ad1e *** empty log message *** 2005-10-20 14:20:41 +00:00
Jim Meyering
a4667affc0 (mode_compile): Reject an invalid mode string that
starts with an octal digit.  From Andreas Gruenbacher.
2005-10-20 14:20:34 +00:00
Paul Eggert
2ec133706a (make_dir_parents): Don't report an error if an
intermediate directory is in a read-only file system.
2005-10-13 19:05:13 +00:00
Jim Meyering
76890ff048 *** empty log message *** 2005-10-08 09:06:16 +00:00
Jim Meyering
40bf0efd47 (rpl_openat): Use the promoted type (int), not mode_t,
as second argument to va_arg.  Otherwise, some versions of gcc
warn that `if this code is reached, the program will abort'.
2005-10-08 09:05:08 +00:00
Jim Meyering
f754c25d4c *** empty log message *** 2005-10-07 22:07:36 +00:00
Jim Meyering
82ee4b140c Merge from gnulib.
(SIZE_MAX): New macro, if not already defined.
2005-10-07 22:07:27 +00:00
Jim Meyering
a9ede5e986 . 2005-10-07 19:42:03 +00:00
Jim Meyering
3614c42902 *** empty log message *** 2005-10-05 14:54:20 +00:00
Jim Meyering
05e1975d08 (libcoreutils_a_DEPENDENCIES): Remove definition.
Once it's gone, automake generates an equivalent one.
2005-10-05 14:54:17 +00:00
Jim Meyering
d3b8165328 Merge from gnulib. 2005-10-05 09:09:33 +00:00
Jim Meyering
df2b4d3451 *** empty log message *** 2005-10-05 09:09:27 +00:00
Jim Meyering
ed558df65b *** empty log message *** 2005-10-04 15:51:25 +00:00
Jim Meyering
4dffc10f08 Merge from gnulib.
Include sys/types.h before other headers.
2005-10-04 15:51:20 +00:00
Paul Eggert
ca7be84526 Import getdelim.c from gnulib (to fix unused var warnings) then
apply the following fixes:
Include getdelim.h first.  Include <limits.h>.
(SSIZE_MAX): New macro, if not already defined.
(getdelim): Fix buffer overrun on 64-bit hosts with lines longer
than 2 GiB.
2005-10-02 22:49:49 +00:00
Jim Meyering
4a6b465285 *** empty log message *** 2005-10-01 09:49:40 +00:00
Jim Meyering
8050751a86 Protect #include's of sys/socket.h and netdb.h.
Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
AI_* and EAI_* definitions.  Protect function declarations.
2005-10-01 09:49:36 +00:00
Jim Meyering
f9c10dab98 *** empty log message *** 2005-09-30 15:21:26 +00:00
Jim Meyering
03866dcfb9 (fdopendir): Do not define if HAVE_FDOPENDIR. 2005-09-30 15:19:47 +00:00
Jim Meyering
5230885d13 (fdopendir): Do not define if HAVE_FDOPENDIR.
Remove AT_FDCWD test.
Do not consume the fd unless successful.
2005-09-30 15:19:24 +00:00
Paul Eggert
c683e67618 "they wants" -> "they want" 2005-09-29 17:24:21 +00:00
Paul Eggert
63e88f7cef Rely on gettimeofday failure too. 2005-09-29 17:22:19 +00:00
Paul Eggert
37016136c9 (settime): If settimeofday fails, give up right away. 2005-09-29 17:21:44 +00:00
Paul Eggert
346afb38ab * settime.c (settime): Fix { typo in previous patch. Also, don't
bother returning ENOSYS; just let stime return whatever errno it
wants to return.
2005-09-29 17:19:58 +00:00
Paul Eggert
8c871e2391 (settime): Fix { typo in previous patch. Also, don't
boether returning ENOSYS; just let stime return whatever errno it
wants to return.
2005-09-29 17:19:30 +00:00
Paul Eggert
96e3593902 * xtime.h (XTIME_PRECISION): Now of type int, not long long int. 2005-09-29 16:51:58 +00:00
Paul Eggert
970dc8e4a8 (XTIME_PRECISION): Now of type int, not long long int,
so that the code works even with ancient cpp.  Portability problem
with GCC 2.7.2.1 reported by Thomas M.Ott.
2005-09-29 16:51:40 +00:00
Jim Meyering
6204a2d1bd *** empty log message *** 2005-09-29 13:13:53 +00:00
Jim Meyering
33b113c638 (settime): Move the HAVE_STIME block `up' into an #elif
block, so that we don't even try to compile it if settimeofday is
available.  This works around a compilation failure on OSF1 V5.1,
due to stime requiring a `long int*' while tv_sec is `int'.
2005-09-29 13:13:49 +00:00
Jim Meyering
b2d2351330 *** empty log message *** 2005-09-27 08:59:54 +00:00
Jim Meyering
4e8e195401 *** empty log message *** 2005-09-27 08:59:04 +00:00
Jim Meyering
0ffc4a7d84 [HAVE_CONFIG_H]: Include <config.h>. 2005-09-27 08:58:55 +00:00
Jim Meyering
52e05089cc [HAVE_CONFIG_H]: Include <config.h> conditionally,
to be consistent with gnulib.
2005-09-27 08:44:07 +00:00
Jim Meyering
3cf3a44bbd Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H. 2005-09-27 08:33:47 +00:00
Jim Meyering
9346282a5d *** empty log message *** 2005-09-27 08:21:35 +00:00
Jim Meyering
2d7c20c891 Include <config.h> here, now that strnumcmp-in.h no longer includes it. 2005-09-27 08:21:28 +00:00
Paul Eggert
80065b498b utimens.c portability fixes. 2005-09-26 23:01:25 +00:00
Paul Eggert
a6c8a8e6d4 Include unistd.h, for dup2.
(futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
(futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
2005-09-26 23:01:00 +00:00
Jim Meyering
2c5def0462 . 2005-09-25 17:01:54 +00:00
Jim Meyering
0e5662fd54 . 2005-09-25 12:54:04 +00:00
Jim Meyering
23b9299247 Protect against multiple inclusion. 2005-09-25 06:14:33 +00:00
Paul Eggert
7ee48d8ffb Support having a null PATH if the file descriptor is nonnegative. 2005-09-25 06:09:22 +00:00
Paul Eggert
4f001e7a13 (ENOSYS): Define if not already defined.
(ftimens): Support having a null PATH if the file descriptor
is nonnegative.
2005-09-25 06:08:45 +00:00
Paul Eggert
443ddc13e6 Upgrade regex_internal.h patch. 2005-09-25 04:18:54 +00:00
Paul Eggert
793ffcaac0 (__GNUC_PREREQ, always_inline, inline, pure):
Remove.
(__attribute): Define to empty unless GCC 3.1 or later.
This works around a core dump on OpenBSD 3.4, which has GCC
2.95.3, which dumps core when given __attribute__(()).  It also
simplifies other tests, since we really don't want to bother with
worrying about which ancient version of GCC supported what.
Original problem reported by Yoann Vandoorselaere, with part of
the fix suggested by Derek Price.
2005-09-25 04:18:39 +00:00
Paul Eggert
545dd954d9 * Makefile.am (libcoreutils_a_SOURCES): Remove mbchar.c. 2005-09-24 23:14:21 +00:00
Paul Eggert
944e020290 (libcoreutils_a_SOURCES): Remove mbchar.c, since
it doesn't build in OpenBSD 3.4.  See
<http://lists.gnu.org/archive/html/bug-gnulib/2005-09/msg00242.html>.
2005-09-24 23:14:04 +00:00
Paul Eggert
fd02208ad2 * regex_internal.h (__attribute): Define to nothing for GCC 2. 2005-09-24 22:59:22 +00:00
Paul Eggert
5a29d2d430 (__attribute): Define to nothing for GCC 2.
This works around a core dump on OpenBSD 3.4, which has GCC
2.95.3, which dumps core when given __attribute__(()).
2005-09-24 22:59:06 +00:00
Jim Meyering
5e6117b9ec *** empty log message *** 2005-09-24 13:32:36 +00:00
Jim Meyering
58e399c289 Use #ifdef HAVE_CONFIG_H', not #if HAVE_CONFIG_H', for consistency with gnulib. 2005-09-24 13:32:31 +00:00
Jim Meyering
7bf8267334 *** empty log message *** 2005-09-24 13:27:41 +00:00
Jim Meyering
f6dbf542b4 Include <config.h> from strintcmp.c, not from here. 2005-09-24 13:27:34 +00:00
Jim Meyering
d447dba13d Include <config.h> here, not from strnumcmp-in.h. 2005-09-24 13:26:41 +00:00
Jim Meyering
8f4700c9e1 *** empty log message *** 2005-09-23 23:05:44 +00:00
Jim Meyering
8dbb507ee8 (verify_type__): Use `unsigned int' as the bitfield type
so we can once again use a positive bitfield width of 1 -- now we
don't have to explain why we were using a bitfield width of 2.
2005-09-23 23:05:39 +00:00
Jim Meyering
6d8b96f653 *** empty log message *** 2005-09-23 23:05:16 +00:00
Paul Eggert
ebca458e8e Use 2, not 1, for bitfield size in verify.h. 2005-09-23 21:49:59 +00:00
Paul Eggert
45079da973 (verify_type__): Use 2, not 1, for bitfield size, to avoid
a warning with Irix 6.5 cc.
2005-09-23 21:49:31 +00:00
Paul Eggert
28475f652b Log recent changes. 2005-09-23 21:40:12 +00:00
Jim Meyering
a40376f4c5 . 2005-09-23 20:14:20 +00:00
Paul Eggert
b9830cafa1 * lib/utimens.c (futimens): Use futimesat if available.
Prefer it to futimes since it doesn't have the futimes bug.
* m4/utimens.m4 (gl_UTIMENS): Check for futimesat.
2005-09-23 19:18:27 +00:00
Paul Eggert
d6ed244c5a Fix typo in comment. 2005-09-23 17:52:22 +00:00
Paul Eggert
ef999bc74a (GL_CONCAT0, GL_CONCAT): Remove.
(verify): Don't use the __LINE__ trick, as it doesn't work in general.
Instead, declare a function that returns a pointer to an array,
and use verify_type__ to declare the size of the array.
Problem and germ of a solution reported by Bruno Haible.
2005-09-23 17:47:15 +00:00
Jim Meyering
a6821efce3 *** empty log message *** 2005-09-23 12:44:07 +00:00
Jim Meyering
81d380e377 Include <config.h>. Otherwise builds with strict
C89 (e.g., Sun's /opt/SUNWspro/bin/c89) would fail due to the use
of `inline'.
2005-09-23 12:42:45 +00:00
Paul Eggert
9fd31b8beb * lib/getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
Problem reported by Eric Blake.
(getaddrinfo): Initialize se so that it's not garbage.
Redo internal storage allocation so that it doesn't make unportable
assumptions about alignment.
Fix a memory leak.
2005-09-23 05:12:50 +00:00
Jim Meyering
fc6f1f7f9c . 2005-09-22 09:47:36 +00:00
Paul Eggert
9bbbf30543 Regenerate. 2005-09-22 07:07:36 +00:00
Paul Eggert
ca9acc01a6 Sync from gnulib. 2005-09-22 07:06:16 +00:00
Paul Eggert
cab86383b8 (libcoreutils_a_SOURCES): Add getaddrinfo.h,
mbchar.c, mbchar.h, mbuiter.h, strcase.h, strlen1.c, strnlen1.h,
strstr.h.
2005-09-22 06:58:56 +00:00
Paul Eggert
eba2793d11 Nontrivial sync from gnulib. 2005-09-22 06:44:26 +00:00
Paul Eggert
da6ced8651 Add getline.h, getpass.c 2005-09-22 06:43:48 +00:00
Paul Eggert
75b92233d8 (GL_CONCAT): Remove.
Include "verify.h" instead.
(ARGMATCH_CONSTRAINT, ARGMATCH_ASSERT): Remove.
(ARGMATCH_VERIFY): Rewrite in terms of new verify macros.
2005-09-22 06:39:14 +00:00
Paul Eggert
fe4ed6c408 (VERIFY_EXPR, X2NREALLOC, X2REALLOC): Remove.
The latter two macros are moving to ../src/system.h for now.
This reverts this file to the gnulib version.
2005-09-22 06:32:52 +00:00
Paul Eggert
8cec6716df Remove; no longer used. 2005-09-22 06:26:54 +00:00
Paul Eggert
3833e2bc34 New file, from gnulib. 2005-09-22 06:22:44 +00:00
Paul Eggert
0ed6bb9a65 Add getaddrinfo.h, getdelim.h, mbchar.h,
mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
2005-09-22 06:22:31 +00:00
Paul Eggert
2d0c5eefd0 Sync from gnulib. 2005-09-22 06:05:39 +00:00
Paul Eggert
5a43b499b1 Sort. 2005-09-22 05:47:40 +00:00
Paul Eggert
0adb008b03 (ENOSYS): Define to EEXIST if not defined.
(make_dir_parents): Treat ENOSYS like EEXIST.
2005-09-22 05:42:26 +00:00
Jim Meyering
08c07f2a1c . 2005-09-21 17:07:09 +00:00
Jim Meyering
b0ecfaf324 *** empty log message *** 2005-09-20 13:51:20 +00:00
Jim Meyering
5205b73810 (fdopendir): Be sure to close the supplied
file descriptor before returning.  This makes our replacement
implementation a little closer to Solaris's, where fdopendir
ties the file descriptor to the returned DIR* pointer.
2005-09-20 13:51:01 +00:00
Jim Meyering
ea66df2090 *** empty log message *** 2005-09-19 15:45:09 +00:00
Jim Meyering
ee8931ea8e (unlinkat): New function. 2005-09-19 15:45:05 +00:00
Jim Meyering
a1052bb3d9 (unlinkat): Add prototype. 2005-09-19 15:44:57 +00:00
Paul Eggert
90306bc508 (set_stat_atime, set_stat_ctime, set_stat_mtime): Remove; they were
buggy in the HAVE_STRUCT_STAT_ST_SPARE1 case, and they were dubious
anyway.  I rewrote 'tar' to not use them any more.
2005-09-17 06:54:22 +00:00
Paul Eggert
96971b59be Regenerate. 2005-09-16 07:58:03 +00:00
Paul Eggert
555bbf598d Import file time stamp resolution improvements from gnulib. 2005-09-16 07:55:12 +00:00
Paul Eggert
e9f5a9b719 Include stat-time.h.
(SYSCALL_RESOLUTION): Depend on whether various struct stat
members exist, not on the obsolescent ST_MTIM_NSEC.
(utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
2005-09-16 07:39:41 +00:00
Paul Eggert
b5a377a22b (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
(MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
in a different way.
(timespec_cmp): New function.
2005-09-16 07:39:18 +00:00
Paul Eggert
24e27d10f9 New file. 2005-09-16 07:36:48 +00:00
Paul Eggert
2bc8e10316 Add stat-time.h. 2005-09-16 07:36:35 +00:00
Jim Meyering
3da8b9a6d8 *** empty log message *** 2005-09-16 07:35:32 +00:00
Jim Meyering
4fa029bd7d (libcoreutils_a_SOURCES): Add fprintftime.c and fprintftime.h. 2005-09-16 07:32:13 +00:00
Jim Meyering
5d8614cf2f *** empty log message *** 2005-09-16 07:31:34 +00:00
Jim Meyering
0277ce3913 [FPRINTFTIME] (fprintftime): Provide a new interface:
size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
		    int utc, int nanoseconds);
Background:
date should not have to allocate a megabyte of virtual memory to
handle a format argument like +%1048575T.  When implemented with
strftime, it must allocate such a buffer, use strftime to fill it
in, print it, then free it.

With fprintftime, it simply prints everything and exits.
With no need for memory allocation, that's one fewer way to fail.
2005-09-16 07:31:29 +00:00
Jim Meyering
ab526003e4 *** empty log message *** 2005-09-16 07:01:00 +00:00
Paul Eggert
0144e1ae89 Rewrite previous strftime change slightly. 2005-09-15 18:48:13 +00:00
Paul Eggert
a08b44ea30 (my_strftime): Rewrite the previous change slightly,
to make it a bit faster and (I hope) clearer.
2005-09-15 18:47:56 +00:00
Jim Meyering
5185512286 *** empty log message *** 2005-09-14 16:10:41 +00:00