* bootstrap: Add stdio-safer, unistd-safer modules.

Remove m4/glibc2.m4 (introduced by latest gnulib, but
we don't need it).
* lib/.cvsignore: Add dup-safer.c, fd-safer.c,
fopen-safer.c, stdio-safer.h, unistd-safer.h.
* lib/subpipe.c: Include "unistd-safer.h".
(create_subpipe): Make sure all the newly-created
file descriptors are > 2, so that diagnostics don't
get sent down them (which might cause Bison to hang, in theory).
* m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
* src/files.c (xfopen): Use fopen_safer, not fopen.
This commit is contained in:
Paul Eggert
2005-05-22 08:04:06 +00:00
parent 51c30d2144
commit 3ea5f0ec81
6 changed files with 39 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
/* Open and close files for Bison.
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -95,7 +95,7 @@ xfopen (const char *name, const char *mode)
{
FILE *ptr;
ptr = fopen (name, mode);
ptr = fopen_safer (name, mode);
if (!ptr)
error (EXIT_FAILURE, get_errno (), _("cannot open file `%s'"), name);