+2018-06-26 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #13888]
+ * posix/Makefile (CFLAGS-tst-spawn3.c): New variable.
+ * posix/tst-spawn3.c (do_test): Put tst-spwan3.pid in OBJPFX, not
+ /tmp.
+ * scripts/test-installation.pl: Put temporary files in build
+ directory, not /tmp.
+ * stdio-common/Makefile (CFLAGS-bug3.c): New variable.
+ (CFLAGS-bug4.c): Likewise.
+ (CFLAGS-bug5.c): Likewise.
+ (CFLAGS-test-fseek.c): Likewise.
+ (CFLAGS-test-popen.c): Likewise.
+ (CFLAGS-test_rdwr.c): Likewise.
+ * stdio-common/bug3.c (main): Put temporary file in OBJPFX, not
+ /tmp.
+ * stdio-common/bug4.c (main): Likewise.
+ * stdio-common/bug5.c (main): Likewise.
+ * stdio-common/test-fseek.c (TESTFILE): Likewise.
+ * stdio-common/test-popen.c (do_test): Likewise.
+ * stdio-common/test_rdwr.c (main): Likewise.
+
2018-06-26 Patsy Franklin <pfrankli@redhat.com>
* nptl/sem_open.c [!__HAVE_64B_ATOMICS] (sem_open): Don't update pad.
tst-boost-ARGS = BOOST.tests
bug-glob1-ARGS = "$(objpfx)"
tst-execvp3-ARGS = --test-dir=$(objpfx)
+CFLAGS-tst-spawn3.c += -DOBJPFX=\"$(objpfx)\"
testcases.h: TESTS TESTS2C.sed
LC_ALL=C sed -f TESTS2C.sed < $< > $@T
if (posix_spawn_file_actions_init (&a) != 0)
FAIL_EXIT1 ("posix_spawn_file_actions_init");
- /* Executes a /bin/sh echo $$ 2>&1 > /tmp/tst-spawn3.pid . */
- const char pidfile[] = "/tmp/tst-spawn3.pid";
+ /* Executes a /bin/sh echo $$ 2>&1 > ${objpfx}tst-spawn3.pid . */
+ const char pidfile[] = OBJPFX "tst-spawn3.pid";
if (posix_spawn_file_actions_addopen (&a, STDOUT_FILENO, pidfile, O_WRONLY |
O_CREAT | O_TRUNC, 0644) != 0)
FAIL_EXIT1 ("posix_spawn_file_actions_addopen");
# We expect none or one argument.
if ($#ARGV == -1) {
+ $dir = ".";
$soversions="soversions.mk";
$config="config.make";
} elsif ($#ARGV == 0) {
if (-d $ARGV[0]) {
+ $dir = $ARGV[0];
$soversions = "$ARGV[0]/soversions.mk";
$config = "$ARGV[0]/config.make";
} else {
# Create test program and link it against all
# shared libraries
-open PRG, ">/tmp/test-prg$$.c"
- or die ("Couldn't write test file /tmp/test-prg$$.c");
+open PRG, ">$dir/test-prg$$.c"
+ or die ("Couldn't write test file $dir/test-prg$$.c");
print PRG '
#include <stdio.h>
';
close PRG;
-open GCC, "$CC /tmp/test-prg$$.c $link_libs -o /tmp/test-prg$$ 2>&1 |"
+open GCC, "$CC $dir/test-prg$$.c $link_libs -o $dir/test-prg$$ 2>&1 |"
or die ("Couldn't execute $CC!");
while (<GCC>) {
$ok = 1;
%found = ();
-open LDD, "ldd /tmp/test-prg$$ |"
+open LDD, "ldd $dir/test-prg$$ |"
or die ("Couldn't execute ldd");
while (<LDD>) {
if (/^\s*lib/) {
&installation_problem unless $ok;
# Finally execute the test program
-system ("/tmp/test-prg$$") == 0
+system ("$dir/test-prg$$") == 0
or die ("Execution of test program failed");
# Clean up after ourselves
-unlink ("/tmp/test-prg$$", "/tmp/test-prg$$.c");
+unlink ("$dir/test-prg$$", "$dir/test-prg$$.c");
CFLAGS-scanf17.c += -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
-I../wctype
+CFLAGS-bug3.c += -DOBJPFX=\"$(objpfx)\"
+CFLAGS-bug4.c += -DOBJPFX=\"$(objpfx)\"
+CFLAGS-bug5.c += -DOBJPFX=\"$(objpfx)\"
+CFLAGS-test-fseek.c += -DOBJPFX=\"$(objpfx)\"
+CFLAGS-test-popen.c += -DOBJPFX=\"$(objpfx)\"
+CFLAGS-test_rdwr.c += -DOBJPFX=\"$(objpfx)\"
+
# tst-gets.c tests a deprecated function.
CFLAGS-tst-gets.c += -Wno-deprecated-declarations
{
FILE *f;
int i;
- const char filename[] = "/tmp/bug3.test";
+ const char filename[] = OBJPFX "bug3.test";
f = fopen(filename, "w+");
for (i=0; i<9000; i++)
FILE *f;
int i;
char buffer[31];
- const char filename[] = "/tmp/bug4.test";
+ const char filename[] = OBJPFX "bug4.test";
while ((i = getopt (argc, argv, "rw")) != -1)
switch (i)
{
FILE *in;
FILE *out;
- static char inname[] = "/tmp/bug5.in";
- static char outname[] = "/tmp/bug5.out";
+ static char inname[] = OBJPFX "bug5test.in";
+ static char outname[] = OBJPFX "bug5test.out";
char *printbuf;
size_t i;
int result;
#include <stdio.h>
-#define TESTFILE "/tmp/test.dat"
+#define TESTFILE OBJPFX "test.dat"
static int
do_test (void)
the perhaps incompatible new shared libraries. */
unsetenv ("LD_LIBRARY_PATH");
- output = popen ("/bin/cat >/tmp/tstpopen.tmp", "w");
+ output = popen ("/bin/cat >" OBJPFX "tstpopen.tmp", "w");
if (output == NULL)
{
perror ("popen");
write_data (output);
wstatus = pclose (output);
printf ("writing pclose returned %d\n", wstatus);
- input = popen ("/bin/cat /tmp/tstpopen.tmp", "r");
+ input = popen ("/bin/cat " OBJPFX "tstpopen.tmp", "r");
if (input == NULL)
{
- perror ("/tmp/tstpopen.tmp");
+ perror (OBJPFX "tstpopen.tmp");
puts ("Test FAILED!");
exit (1);
}
rstatus = pclose (input);
printf ("reading pclose returned %d\n", rstatus);
- remove ("/tmp/tstpopen.tmp");
+ remove (OBJPFX "tstpopen.tmp");
errno = 0;
output = popen ("/bin/cat", "m");
else
name = *argv;
- (void) sprintf (filename, "/tmp/%s.test", name);
+ (void) sprintf (filename, OBJPFX "%s.test", name);
f = fopen (filename, "w+");
if (f == NULL)