1. 01 Jan, 2010 1 commit
  2. 17 Dec, 2009 1 commit
    • Eric Blake's avatar
      fcntl: use to simplify other modules · e4ee1420
      Eric Blake authored
      Let fcntl do the work, instead of copying code into other modules.
      
      * modules/cloexec (Depends-on): Add fcntl.
      * modules/fchdir (Depends-on): Likewise.
      * modules/fd-safer-flag (Depends-on): Likewise.
      * modules/unistd-safer (Depends-on): Likewise.
      * modules/dup3 (configure.ac): Set module indicator.
      * m4/fchdir.m4 (gl_FUNC_FCHDIR): Replace fcntl if fchdir is
      missing.
      * lib/fchdir.c (_gl_register_dup): Fix comment.
      * lib/cloexec.c (dup_cloexec): Simplify, by relying on fcntl.
      * lib/dup-safer.c (dup_safer): Likewise.
      * lib/dup-safer-flag.c (dup_safer_flag): Likewise.
      * lib/dup3.c (dup3): Likewise.
      * tests/test-fchdir.c (main): Enhance test.
      Fixes a dup_cloexec bug reported by Ondřej Vašík.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      e4ee1420
  3. 11 Dec, 2009 1 commit
  4. 05 Dec, 2009 1 commit
    • Eric Blake's avatar
      unistd-safer: allow preservation of cloexec status via flag · 14449a1d
      Eric Blake authored
      If cloexec is in use, allow the ability to preserve cloexec
      flag across *_safer functions.
      
      * lib/unistd-safer.h (dup_safer_flag, fd_safer_flag): New
      prototypes.
      * lib/dup-safer.c (dup_safer_flag): New function.
      * lib/fd-safer.c (fd_safer_flag): Likewise.
      * modules/cloexec (configure.ac): Set witness.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      14449a1d
  5. 03 Sep, 2009 1 commit
    • Eric Blake's avatar
      fchdir: use more consistent macro convention · dd66a62c
      Eric Blake authored
      * lib/fcntl.in.h (_gl_register_fd): Move declaration to unistd.
      * lib/sys_stat.in.h (rpl_fstat): Declare via make-time
      REPLACE_FCHDIR, rather than relying on config.h macros.
      * lib/unistd.in.h (fchdir): Move all fchdir internal declarations
      inside a single make-time REPLACE_FCHDIR block, rather than using
      the config.h FCHDIR_REPLACEMENT.
      * m4/fchdir.m4 (gl_FUNC_FCHDIR): REPLACE_FCHDIR was already
      AC_SUBST'd, also AC_DEFINE it.  Don't define FCHDIR_REPLACEMENT.
      Manage fstat replacement.
      * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Pick up
      REPLACE_FCHDIR.
      * modules/sys_stat (Files): Add m4/unistd_h.m4.
      (Makefile.am): Substitute REPLACE_FCHDIR.
      * lib/close.c (rpl_close): Use REPLACE_FCHDIR, not
      FCHDIR_REPLACEMENT.
      * lib/dup-safer.c (dup_safer): Likewise.
      * lib/dup2.c (rpl_dup2): Likewise.
      * lib/dup3.c (rpl_dup3): Likewise.
      * lib/open.c (rpl_open): Likewise.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      dd66a62c
  6. 19 Jan, 2009 1 commit
    • Eric Blake's avatar
      unistd: guarantee STDIN_FILENO here, for OS/2 EMX · ae5dae6f
      Eric Blake authored
      * lib/unistd.in.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
      Guarantee a definition.
      * doc/posix-headers/unistd.texi (unistd.h): Document the bug.
      * modules/unistd-safer (Depends-on): Add dependency on unistd.
      * lib/c-stack.c (STDERR_FILENO): Rely on <unistd.h>.
      * lib/dup-safer.c (STDERR_FILENO): Likewise.
      * lib/execute.c (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
      Likewise.
      * lib/fd-safer.c (STDIN_FILENO, STDERR_FILENO): Likewise.
      * lib/fopen-safer.c (STDERR_FILENO): Likewise.
      * lib/pipe.c (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
      Likewise.
      * lib/tmpfile-safer.c (STDERR_FILENO): Likewise.
      * tests/test-posix_spawn1.c (STDIN_FILENO, STDOUT_FILENO)
      (STDERR_FILENO): Likewise.
      * tests/test-posix_spawn2.c (STDIN_FILENO, STDOUT_FILENO)
      (STDERR_FILENO): Likewise.
      * tests/test-posix_spawn3.c (STDIN_FILENO, STDOUT_FILENO)
      (STDERR_FILENO): Likewise.
      Reported by Elbert Pol.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      ae5dae6f
  7. 07 Oct, 2007 1 commit
  8. 14 Jan, 2007 1 commit
  9. 13 Sep, 2006 1 commit
    • Paul Eggert's avatar
      * _fpending.c: Include <config.h> unconditionally, since we no · 0632e115
      Paul Eggert authored
      longer worry about uses that don't define HAVE_CONFIG_H.
      * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c:
      * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c:
      * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c:
      * cloexec.c, close-stream.c, closeout.c, creat-safer.c:
      * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c:
      * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c:
      * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c:
      * file-type.c, fileblocks.c, filemode.c, filenamecat.c:
      * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c:
      * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c:
      * getcwd.c, getdate.y, getdomainname.c, getgroups.c:
      * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c:
      * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c:
      * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
      * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c:
      * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c:
      * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c:
      * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c:
      * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c:
      * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c:
      * mountlist.c, nanosleep.c, obstack.c, open-safer.c:
      * openat-die.c, openat.c, pagealign_alloc.c, physmem.c:
      * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
      * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c:
      * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c:
      * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c:
      * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c:
      * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c:
      * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c:
      * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c:
      * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c:
      * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c:
      * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c:
      * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
      Likewise.
      0632e115
  10. 19 Sep, 2005 1 commit
    • Paul Eggert's avatar
      Use a consistent style for including <config.h>. · 222b0486
      Paul Eggert authored
      * __fpending.c, acl.c, argmatch.c,
      argp-help.c, argp-parse.c,
      argp-pvh.c, backupfile.c, basename.c, c-stack.c,
      calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c,
      creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c,
      dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c,
      fd-safer.c, file-type.c, fileblocks.c, filemode.c,
      filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c,
      fsusage.c, ftruncate.c, full-write.c, fwriteerror.c,
      getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c,
      getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c,
      hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c,
      inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c,
      memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c,
      modechange.c, mountlist.c, open-safer.c, physmem.c,
      pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c,
      progreloc.c, putenv.c, quote.c, quotearg.c, readline.c,
      readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c,
      safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c,
      strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c,
      strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c,
      strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c,
      userspec.c, utimecmp.c, version-etc-fsf.c,
      version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c,
      xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c,
      xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c:
      Standardize inclusion of config.h.
      * __fpending.h, dirfd.h, getdate.h, human.h,
      inttostr.h:  Removed inclusion of config.h from header files.
      * inttostr.c:  Adjusted in-tree users.
      * timespec.h: Remove superfluous warning to include config.h.
      * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c,
      gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c,
      nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c,
      unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
      222b0486
  11. 27 Aug, 2005 1 commit
  12. 02 Jul, 2005 1 commit
  13. 14 May, 2005 1 commit
  14. 02 May, 2005 1 commit
  15. 06 Aug, 2004 1 commit
  16. 03 Mar, 2001 1 commit
  17. 07 Aug, 2000 1 commit
  18. 09 Jul, 2000 1 commit
  19. 01 May, 1999 1 commit
  20. 16 Jul, 1998 1 commit
  21. 11 Apr, 1998 1 commit
  22. 10 Oct, 1996 1 commit
  23. 15 Jul, 1996 1 commit
  24. 14 Jul, 1996 1 commit
  25. 08 Jan, 1995 1 commit
  26. 10 Dec, 1994 1 commit
  27. 02 Oct, 1994 1 commit
  28. 26 Jan, 1994 2 commits
  29. 29 Dec, 1993 1 commit