Commit Graph

21056 Commits

Author SHA1 Message Date
Paul Eggert
f2c653e8df Improve diagnostics for restore_cwd failure. 2005-06-14 23:58:00 +00:00
Paul Eggert
153854cc31 (make_dir): Remove. All uses replaced by mkdir.
(make_dir_parents): Last arg is now int * (for errno), not bool *.
Rewrite "mkdir -p" algorithm to avoid the need for "stat"
each time through the loop.  Do not diagnose restore_cwd failure;
that is the caller's job (and perhaps the caller does not care).
2005-06-14 23:56:49 +00:00
Paul Eggert
616a6e5146 (make_dir): Remove. All uses replaced by mkdir.
(make_dir_parents): Last arg is now int * (for errno), not bool *.
2005-06-14 23:56:17 +00:00
Paul Eggert
0b2ac253e7 (create_parents): Remove static var (now local to 'main').
(main): Standardize on a diagnostic for restore_cwd failure,
and report errno.
Don't bother to check cwd_errno unless create_parents.
Use mkdir rather than make_dir; it's simpler.
2005-06-14 23:55:47 +00:00
Paul Eggert
3f47e8458a (main): Standardize on a diagnostic for
restore_cwd failure, and report errno.
(install_file_in_file_parents): Fail if restore_cwd fails and
one of the files is relative.  This fixes a bug (albeit unlikely).
2005-06-14 23:55:24 +00:00
Paul Eggert
d203fc19ae mkdir-p cleanup. 2005-06-14 18:36:44 +00:00
Paul Eggert
9c0241d8e2 Adjust to new make_dir_parents convention. 2005-06-14 18:36:25 +00:00
Paul Eggert
7cc0d42200 (main): Adjust to new make_dir_parents convention. 2005-06-14 18:35:58 +00:00
Paul Eggert
f7bbc5d1a2 (CLEANUP_CWD, CLEANUP): Remove.
(make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
If the file already exists but is not a directory, don't bother
to try to make its parents.
Close potential file descriptor leak if we can't chdir("/") (!).
Don't always return true if chdir($PWD) fails; return true only
if the requested action was done successfully (except for the
chdir($PWD)).
Don't log final directory unless we actually made it.
Refactor to avoid duplicate code to fix up permissions.
Don't attempt to fix up parent permissions if chdir($PWD) fails.
2005-06-14 18:35:38 +00:00
Jim Meyering
5c3c5b0586 *** empty log message *** 2005-06-14 09:46:39 +00:00
Jim Meyering
b95fca684c Reflect s/_die/_fail/ renaming. 2005-06-14 09:46:24 +00:00
Jim Meyering
f23e1c18a8 (openat_save_fail): Rename from openat_save_die.
(openat_restore_fail): Rename from openat_restore_die.
2005-06-14 09:44:54 +00:00
Jim Meyering
e6b19a2245 *** empty log message *** 2005-06-14 09:00:05 +00:00
Jim Meyering
dbc8afd399 Ensure mkdir succeeds if the following argument is an absolute directory name. 2005-06-14 09:00:00 +00:00
Jim Meyering
cb7512d04d clarify comment 2005-06-14 08:55:37 +00:00
Jim Meyering
cb3b87f4d7 *** empty log message *** 2005-06-14 08:53:11 +00:00
Jim Meyering
1fbdda3dc2 (CLEANUP_CWD): Return *true*, not false when failing
to restore initial working directory.
2005-06-14 08:48:13 +00:00
Jim Meyering
3b6523f00a *** empty log message *** 2005-06-14 08:26:43 +00:00
Jim Meyering
4fb9497455 Change openat.c to openat-die.c. 2005-06-14 08:26:37 +00:00
Jim Meyering
5507a4a721 *** empty log message *** 2005-06-14 08:25:56 +00:00
Jim Meyering
c89c93ecf6 (my-distcheck): Add -Wall to the list of options that
are used with -Werror.  This target is not intended for general use.
2005-06-14 08:25:53 +00:00
Jim Meyering
a0e071d050 . 2005-06-14 08:19:18 +00:00
Jim Meyering
19c47583a2 tweak diagnostic wording: Use `... return to working directory', rather
than `... restore working directory'.
2005-06-14 08:18:43 +00:00
Jim Meyering
bf684a6106 whoops.
redirect stderr to dev/null
2005-06-14 08:16:18 +00:00
Jim Meyering
a35d3cb4f8 . 2005-06-14 08:00:46 +00:00
Jim Meyering
27a8731d4e *** empty log message *** 2005-06-14 08:00:16 +00:00
Jim Meyering
d9b86c6156 (TESTS): Add p-3. 2005-06-14 07:59:59 +00:00
Jim Meyering
6000585c85 remove obsolete FIXME 2005-06-14 07:55:32 +00:00
Jim Meyering
018984aae7 *** empty log message *** 2005-06-14 07:47:57 +00:00
Jim Meyering
ba4a12e58d (gl_FUNC_OPENAT): Add openat-die.c. 2005-06-14 07:47:52 +00:00
Jim Meyering
30b65617ac *** empty log message *** 2005-06-14 06:55:32 +00:00
Jim Meyering
3e915a8263 (openat_save_die, openat_restore_die): New file. 2005-06-14 06:55:24 +00:00
Jim Meyering
5985c9991b (openat_save_die, openat_restore_die): Declare and define. 2005-06-14 06:54:57 +00:00
Jim Meyering
8c98346f6f Provide an alternative to exiting immediately upon save_cwd or
restore_cwd failure.  Now, an application can arrange e.g.,
to perform a longjump in that case.
* openat.c: Include dirname.h.
Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
(rpl_openat, fdopendir, fstatat): Call openat_save_die
and openat_restore_die rather than calling error directly.
Don't include "error.h" or "exitfail.h"; they're no longer needed.

* openat-die.c (openat_save_die, openat_restore_die): New file.
* openat.h (openat_save_die, openat_restore_die): Declare and define.
2005-06-14 06:54:39 +00:00
Jim Meyering
57f2a7090c *** empty log message *** 2005-06-13 10:22:29 +00:00
Jim Meyering
15de627dec (make_dir_parents): Update prototype. 2005-06-13 10:22:26 +00:00
Jim Meyering
1cd524bfb2 *** empty log message *** 2005-06-13 10:21:32 +00:00
Jim Meyering
069175c396 *** empty log message *** 2005-06-13 10:20:39 +00:00
Jim Meyering
fd49083b38 *** empty log message *** 2005-06-13 10:19:23 +00:00
Jim Meyering
736dfd391d (main): When make_dir_parents changes the current working
directory, give a diagnostic about each subsequent failure to create
a dot-relative directory.
(install_file_in_file_parents): Update make_dir_parents caller.
2005-06-13 10:19:18 +00:00
Jim Meyering
4063f9696c (main): When make_dir_parents changes the current working
directory, give a diagnostic about each subsequent failure to create
a dot-relative directory.
2005-06-13 10:17:36 +00:00
Jim Meyering
ecd375b64a (make_dir_parents): New parameter: different_working_dir,
to tell caller if/when we change the working directory and are
unable to return to the initial one.
2005-06-13 10:15:19 +00:00
Jim Meyering
26438e44cd *** empty log message *** 2005-06-12 19:56:42 +00:00
Jim Meyering
78c87e1292 (CLEANUP_CWD): Change one more return 1' to return false'.
This fixes a bug introduced on 2004-07-30.
2005-06-12 19:56:37 +00:00
Paul Eggert
d30b64a98e Act on the Austin Group's response yesterday to XCU ERN 63. 2005-06-10 19:32:04 +00:00
Paul Eggert
9756cac52f (any_has_acl): New var.
(clear_files): Clear it.
(gobble_file): Set it if a file has an ACL.
(print_long_format): Omit needless space unless some file has an ACL.
2005-06-10 19:31:45 +00:00
Paul Eggert
2de803d91b Remove the extra spaces in "ls -l" output. 2005-06-10 19:31:24 +00:00
Paul Eggert
a53809b3df ls no longer outputs an extra space between mode and link count. 2005-06-10 19:30:51 +00:00
Jim Meyering
939f88af26 *** empty log message *** 2005-06-10 16:42:33 +00:00
Jim Meyering
4fb3780059 (VERIFY_W_TYPEOF): Add parentheses. 2005-06-10 16:42:28 +00:00