File:  [MW Coherent from dump] / coherent / g / usr / lib / uucp / tay104 / unix / rmdir.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/* rmdir.c
   Remove a directory on a system which doesn't have the rmdir system
   call.  This is only called by uupick, which is not setuid, so we
   don't have to worry about the problems of invoking the setuid
   /bin/rmdir program.  */

#include "uucp.h"

#include "sysdep.h"

#include <errno.h>

int
rmdir (zdir)
     const char *zdir;
{
  const char *azargs[3];
  int aidescs[3];
  pid_t ipid;

  azargs[0] = RMDIR_PROGRAM;
  azargs[1] = zdir;
  azargs[2] = NULL;
  aidescs[0] = SPAWN_NULL;
  aidescs[1] = SPAWN_NULL;
  aidescs[2] = SPAWN_NULL;

  ipid = ixsspawn (azargs, aidescs, TRUE, FALSE, (const char *) NULL,
		   TRUE, TRUE, (const char *) NULL,
		   (const char *) NULL, (const char *) NULL);

  if (ipid < 0)
    return -1;

  if (ixswait ((unsigned long) ipid, (const char *) NULL) != 0)
    {
      /* Make up an errno value.  */
      errno = EBUSY;
      return -1;
    }

  return 0;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.