- if (unlink (to) && errno != ENOENT)
- return -1;
- }
-
- if (S_ISDIR (from_stats.st_mode))
- {
- /* Need a setuid root process to link and unlink directories. */
- pid = fork ();
- switch (pid)
- {
- case -1: /* Error. */
- error (1, errno, "cannot fork");
-
- case 0: /* Child. */
- execl (MVDIR, "mvdir", from, to, (char *) 0);
- error (255, errno, "cannot run `%s'", MVDIR);