Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 17 Dec 2005 06:55:32 +0000 (06:55 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 17 Dec 2005 06:55:32 +0000 (06:55 +0000)
commit3f86aaadcfc70682baab8b676de5cfd7e2340e2c
tree1c54cacbf21c8ff492c897db34509d43a6bcf775
parent1c5cebe7033a90f4350ddb794f905dce68f2d6b8
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.
lib/openat.c