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: }

Defined functions

remdir defined in line 7; never used
Last modified: 1985-11-07
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 580
Valid CSS Valid XHTML 1.0 Strict