#include <wchar.h>
#include <libc-diag.h>
+#include <support/xstdio.h>
+
static int
do_test (int argc, char *argv[])
{
mtrace ();
- (void) freopen (argc == 1 ? "/dev/stdout" : argv[1], "a", stderr);
+ xfreopen (argc == 1 ? "/dev/stdout" : argv[1], "a", stderr);
/* Orient the stream. */
fwprintf (stderr, L"hello world\n");
char buf[20000];
/* Change the root dir. */
TEST_VERIFY (chroot ("/subdir") == 0);
- chdir ("/");
+ xchdir ("/");
/* Check we're NOT using the "inner" nsswitch.conf. */
#include <unistd.h>
#include <sys/stat.h>
+#include <support/xunistd.h>
+
#define OUT_OF_MEMORY \
do { \
close (fd);
snprintf (buf, buflen, "%s/..", testdir);
- chdir (buf);
+ xchdir (buf);
+
/* We are now in the directory above the one we create the test
directory in. */
}
fail:
- chdir (startdir);
+ xchdir (startdir);
/* Remove all the files. */
chmod (testdir, 0700);
if (cwd == NULL)
cwd = "..";
- chdir (cwd);
+ xchdir (cwd);
rmdir (tmpdir);
return 0;
#include <sys/param.h>
#include <sys/stat.h>
+#include <support/xunistd.h>
+
/* Prototype for our test function. */
extern int do_test (int argc, char *argv[]);
#include <test-skeleton.c>
}
for (i = 0; i < (int) (sizeof (symlinks) / sizeof (symlinks[0])); ++i)
- symlink (symlinks[i].value, symlinks[i].name);
+ xsymlink (symlinks[i].value, symlinks[i].name);
int has_dir = mkdir ("doesExist", 0777) == 0;