---

--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -57,6 +57,10 @@
 #include <dlfcn.h>
 #endif
 
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 // Put in a hack for Cygwin which falsely reports that the mkdtemp function
 // is available when it is not.
 #ifdef __CYGWIN__
@@ -731,9 +735,18 @@
   }
 
   if (remove_contents) {
+    int rv;
     // Recursively descend the directory to remove its contents.
-    std::string cmd = "/bin/rm -rf " + path;
-    if (system(cmd.c_str()) != 0) {
+    switch (fork()) {
+    case -1:
+      return MakeErrMsg(ErrStr, path + ": failed to fork (recursively removing directory).");
+    case 0:
+      execl("/bin/rm", "/bin/rm", "-rf", "--", path.c_str(), (char *) 0);
+      exit(1);
+    default:
+      wait(&rv);
+    }
+    if (rv != 0) {
       MakeErrMsg(ErrStr, path + ": failed to recursively remove directory.");
       return true;
     }
