Commit fb8c836a authored by Eric Blake's avatar Eric Blake
Browse files

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.
Signed-off-by: default avatarEric Blake <ebb9@byu.net>
parent a8f637e3
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
......@@ -20,8 +20,12 @@
#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
......@@ -10,6 +10,7 @@ m4/fcntl-safer.m4
m4/mode_t.m4
Depends-on:
fcntl
open
unistd-safer
......
......@@ -8,6 +8,7 @@ lib/fopen-safer.c
m4/stdio-safer.m4
Depends-on:
fopen
unistd-safer
configure.ac:
......
......@@ -9,10 +9,12 @@ m4/stdlib-safer.m4
Depends-on:
mkstemp
stdlib
unistd-safer
configure.ac:
gl_STDLIB_SAFER
gl_MODULE_INDICATOR([stdlib-safer])
Makefile.am:
......
......@@ -9,10 +9,12 @@ m4/stdio-safer.m4
Depends-on:
binary-io
tmpfile
unistd-safer
configure.ac:
gl_TMPFILE_SAFER
gl_MODULE_INDICATOR([tmpfile-safer])
Makefile.am:
......
......@@ -14,6 +14,7 @@ unistd
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
......@@ -21,6 +21,10 @@
#include <stdio.h>
#include <stdlib.h>
#if GNULIB_FOPEN_SAFER
# include "stdio--.h"
#endif
#define ASSERT(expr) \
do \
{ \
......
......@@ -23,6 +23,10 @@
#include <stdio.h>
#include <stdlib.h>
#if GNULIB_FCNTL_SAFER
# include "fcntl--.h"
#endif
#define ASSERT(expr) \
do \
{ \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment