Age | Commit message (Collapse) | Author |
|
|
|
|
|
(setup_dir, free_dir): New functions.
(enter_dir, leave_dir): Define trivial
alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
(HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
(LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
(struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
Move to fts-cycle.c.
(fts_open): Use setup_dir.
(fts_close): Use free_dir.
(fts_read): Have just one copy of the ENTER_DIR code rather than three.
This adds a label and some gotos, but the alternatives were messier.
Check for memory allocation failure when entering a dir.
(fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
|
|
(FTS): New member fts_cycle, that is a union that contains the
old active_dir_ht and cycle_state. All uses changed to mention
fts_cycle.ht and fts_cycle.state.
|
|
fts.c, with the following changes:
(setup_dir, free_dir): New functions.
(enter_dir): Now returns bool. Return true if successful, false
if memory exhausted. All callers changed.
Do not bother partly cleaning up on
memory allocation failure; that is free_dir's job.
However, free ad if hash_insert fails, to avoid memory leak.
(enter_dir, leave_dir): Accommodate change to FTS by inspecting
fts->fts_options to see which union member to use.
|
|
|
|
Spotted by Paul Eggert.
|
|
|
|
Use #define rather than a static function, to avoid a warning
when the function was not used.
|
|
|
|
|
|
(FTS): Use struct hash_table * instead of Hash_table, so that
we no longer need to include hash.h here.
|
|
Do not include intprops.h; no longer needed.
Include cycle-check.h and hash.h, since fts_.h no longer does.
Remove unnecessary casts of closedir to void.
(fts_build): Use a simpler method (not involving TYPE_SIGNED) to
decide whether to decrement nlinks.
|
|
Include <stddef.h> unconditionally, since we assume C89 now.
All uses of PTR_INT_TYPE replaced by ptrdiff_t.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gethrxtime.c
|
|
unlocked-io.h
gethrxtime.h
mountlist.h
xtime.h
path-concat.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(fts_open): Don't cast a function value in a possibly-unsafe way.
(fts_compar): New function.
(fts_sort): Use it.
|
|
(FTSENT): New member fts_fts. Remove members fts_ino, fts_dev,
fts_nlink; no longer needed now that fts_statp is always there.
All uses changed to use fts_statp instead.
|
|
(yesno): Don't remove leading white space; POSIX doesn't allow it.
Use getline to remove arbitrary restriction on response length.
|
|
starts with exactly two slashes.
|
|
starts with exactly two slashes.
|
|
|
|
|
|
* modechange.c: Likewise. Simplify internals a bit. Prohibit "+0".
|
|
|
|
xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
(MODE_DONE): New constant.
(struct mode_change): Remove 'next' member.
(make_node_op_equals): New function; like the old one of the
same name, except it allocates an array.
(mode_compile, mode_create_from_ref): Use it.
(mode_compile): Allocate result as an array, not a linked list.
Parse octal string ourself, so that we catch mistakes like "+0".
(mode_adjust): Arg is an array, not a linked list.
|
|
|
|
|
|
[!_LIBC] Include "stat-macros.h" instead.
|
|
* filetype.h: Don't assume <sys/stat.h> was included first.
|
|
(struct mode_change): Move to modechange.c; callers don't
need to see this stuff.
(MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
(MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
(mode_change, mode_adjust): Reflect the new signatures noted above.
|
|
(S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
(S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
(S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
Remove. This is now stat-macros.h's job.
(talloc): Remove. All callers replaced by xalloc, so that
our invokers don't have to worry about reporting memory failures.
(make_node_op_equals): Remove.
(MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
New constants.
(struct mode_change): Moved here from modechange.h.
(mode_append_entry): Remove.
(mode_compile): Remove MASKED_OPS arg, since it encouraged
apps to have incorrect behavior. Use simpler algorithm for head
and tail. Don't futz with umask; that's now the job of mode_adjust.
Detect more invalid usages rather than having somewhat-random behavior.
Don't insert an "a=" action, as that leads to incorrect behavior.
(mode_compile, mode_create_from_ref): Return NULL on error instead
of an enum, since now there's only one way to have an error. All
callers changed.
(mode_adjust): Accept new arg UMASK_VALUE, and interpret it
at the correct time. Simplify calculation of "+u" and its ilk.
Don't mishandle "+X".
(mode_free): Remove "register" and localize decls.
|
|
|
|
|
|
|