diff options
Diffstat (limited to 'io/ftwtest.c')
-rw-r--r-- | io/ftwtest.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/io/ftwtest.c b/io/ftwtest.c index 851ed1d587..4f527997df 100644 --- a/io/ftwtest.c +++ b/io/ftwtest.c @@ -70,9 +70,22 @@ main (int argc, char *argv[]) if (do_phys) flag |= FTW_PHYS; + char *cw1 = getcwd (NULL, 0); + r = nftw (optind < argc ? argv[optind] : ".", cb, do_exit ? 1 : 3, flag); if (r < 0) perror ("nftw"); + + char *cw2 = getcwd (NULL, 0); + + if (strcmp (cw1, cw2) != 0) + { + printf ("current working directory before and after nftw call differ:\n" + "before: %s\n" + "after: %s\n", cw1, cw2); + exit (1); + } + if (do_exit) { puts (r == 26 ? "succeeded" : "failed"); |