|
|
1.1 ! root 1: /* remdir.c - remove a directory */ ! 2: ! 3: #include "../h/mh.h" ! 4: #include <stdio.h> ! 5: ! 6: ! 7: remdir (dir) ! 8: char *dir; ! 9: { ! 10: #ifndef BSD42 ! 11: int pid; ! 12: #endif not BSD42 ! 13: ! 14: m_update (); ! 15: (void) fflush (stdout); ! 16: ! 17: #ifndef BSD42 ! 18: switch (pid = vfork ()) { ! 19: case NOTOK: ! 20: advise ("fork", "unable to"); ! 21: return 0; ! 22: ! 23: case OK: ! 24: execl ("/bin/rmdir", "rmdir", dir, NULLCP); ! 25: execl ("/usr/bin/rmdir", "rmdir", dir, NULLCP); ! 26: fprintf (stderr, "unable to exec "); ! 27: perror ("rmdir"); ! 28: _exit (-1); ! 29: ! 30: default: ! 31: if (pidXwait (pid, "rmdir")) ! 32: return 0; ! 33: break; ! 34: } ! 35: #else BSD42 ! 36: if (rmdir (dir) == NOTOK) { ! 37: admonish (dir, "unable to remove directory"); ! 38: return 0; ! 39: } ! 40: #endif BSD42 ! 41: ! 42: return 1; ! 43: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.