* modules/fopen-safer (Depends-on): Add fopen.
* modules/fcntl-safer (Depends-on): Add fcntl.
* modules/stdlib-safer (Depends-on): Add stdlib.
(configure.ac): Set indicator.
* modules/unistd-safer (configure.ac): Likewise.
* modules/tmpfile-safer (configure.ac): Likewise.
(Depends-on): Add tmpfile.
* lib/stdio--.h (fopen, tmpfile): Don't override unless module is
active.
* tests/test-fopen.c (includes): Test safer versions when they are
in use.
* tests/test-open.c (includes): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-08-19 Eric Blake <ebb9@byu.net>
+ tests: test some of the *-safer modules
+ * modules/fopen-safer (Depends-on): Add fopen.
+ * modules/fcntl-safer (Depends-on): Add fcntl.
+ * modules/stdlib-safer (Depends-on): Add stdlib.
+ (configure.ac): Set indicator.
+ * modules/unistd-safer (configure.ac): Likewise.
+ * modules/tmpfile-safer (configure.ac): Likewise.
+ (Depends-on): Add tmpfile.
+ * lib/stdio--.h (fopen, tmpfile): Don't override unless module is
+ active.
+ * tests/test-fopen.c (includes): Test safer versions when they are
+ in use.
+ * tests/test-open.c (includes): Likewise.
+
popen: fix cygwin 1.5 bug when stdin closed
* doc/posix-functions/popen.texi (popen): Document cygwin bugs.
* modules/popen: New file.
/* Like stdio.h, but redefine some names to avoid glitches.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stdio.h>
#include "stdio-safer.h"
-#undef fopen
-#define fopen fopen_safer
+#if GNULIB_FOPEN_SAFER
+# undef fopen
+# define fopen fopen_safer
+#endif
-#undef tmpfile
-#define tmpfile tmpfile_safer
+#if GNULIB_TMPFILE_SAFER
+# undef tmpfile
+# define tmpfile tmpfile_safer
+#endif
m4/mode_t.m4
Depends-on:
+fcntl
open
unistd-safer
m4/stdio-safer.m4
Depends-on:
+fopen
unistd-safer
configure.ac:
Depends-on:
mkstemp
+stdlib
unistd-safer
configure.ac:
gl_STDLIB_SAFER
+gl_MODULE_INDICATOR([stdlib-safer])
Makefile.am:
Depends-on:
binary-io
+tmpfile
unistd-safer
configure.ac:
gl_TMPFILE_SAFER
+gl_MODULE_INDICATOR([tmpfile-safer])
Makefile.am:
configure.ac:
gl_UNISTD_SAFER
+gl_MODULE_INDICATOR([unistd-safer])
Makefile.am:
/* Test of opening a file stream.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stdio.h>
#include <stdlib.h>
+#if GNULIB_FOPEN_SAFER
+# include "stdio--.h"
+#endif
+
#define ASSERT(expr) \
do \
{ \
#include <stdio.h>
#include <stdlib.h>
+#if GNULIB_FCNTL_SAFER
+# include "fcntl--.h"
+#endif
+
#define ASSERT(expr) \
do \
{ \