From d88830f05462ced415b299ded26a40e11fc48fe7 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Fri, 24 Jul 2009 00:39:49 -0400 Subject: [PATCH] Chdir() out of the work directory before trying to remove it. SVN-Revision: 1273 --- cpio/test/main.c | 5 +++-- libarchive/test/main.c | 1 + tar/test/main.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cpio/test/main.c b/cpio/test/main.c index b6d0c0e67..e35bd1910 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -825,9 +825,9 @@ static int test_run(int i, const char *tmpdir) if (failures == failures_before) { if (!keep_temp_files && chdir(tmpdir) == 0) { #if defined(_WIN32) && !defined(__CYGWIN__) - systemf("rmdir /S /Q %s", tests[i].name); + systemf("rmdir /S /Q \"%s\"", tests[i].name); #else - systemf("rm -rf %s", tests[i].name); + systemf("rm -rf \"%s\"", tests[i].name); #endif } } @@ -1194,6 +1194,7 @@ int main(int argc, char **argv) /* If the final tmpdir is empty, we can remove it. */ /* This should be the usual case when all tests succeed. */ + chdir(".."); rmdir(tmpdir); return (tests_failed); diff --git a/libarchive/test/main.c b/libarchive/test/main.c index fa6985a8a..18f7df455 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -1277,6 +1277,7 @@ int main(int argc, char **argv) /* If the final tmpdir is empty, we can remove it. */ /* This should be the usual case when all tests succeed. */ + chdir(".."); rmdir(tmpdir); return (tests_failed); diff --git a/tar/test/main.c b/tar/test/main.c index bad34d45b..c4e7004ac 100644 --- a/tar/test/main.c +++ b/tar/test/main.c @@ -1258,6 +1258,7 @@ int main(int argc, char **argv) /* If the final tmpdir is empty, we can remove it. */ /* This should be the usual case when all tests succeed. */ + chdir(".."); rmdir(tmpdir); return (tests_failed); -- 2.47.3