summaryrefslogtreecommitdiff
path: root/usr.bin/mg/fileio.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-02-26 23:22:45 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-02-26 23:22:45 +0000
commita6122aab17ac59ec1bed2bae2cfda414019a877e (patch)
treed3240060d0b9b26005cdecbc3bedc1ff5847ef1b /usr.bin/mg/fileio.c
parentac2dd1683fd459fc832d940eea325eb1725424bb (diff)
Use uid_t, gid_t and mode_t where applicable.
Pull in changes from the BSD-specific sysdef.h and fileio.c: kill bogus unlinkdir() and rename() kludges since we have rmdir(2) and rename(2) define SYMBLINK since we have symlinks TODO: merge BSD spawn.c and ttyio.c
Diffstat (limited to 'usr.bin/mg/fileio.c')
-rw-r--r--usr.bin/mg/fileio.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c
index 52358e8d154..e2fa01f40fb 100644
--- a/usr.bin/mg/fileio.c
+++ b/usr.bin/mg/fileio.c
@@ -1,5 +1,5 @@
/*
- * sys V fileio.c
+ * POSIX fileio.c
*/
#include "def.h"
@@ -304,9 +304,6 @@ register char *fn;
#ifndef NO_STARTUP
#include <sys/file.h>
-#ifndef F_OK
-#define F_OK 04 /* for stupid Sys V */
-#endif
/*
* Find a startup file for the user and return its name. As a service
@@ -348,6 +345,7 @@ notfound:
#endif
#ifndef NO_DIRED
+#include <sys/wait.h>
#include "kbd.h"
/*
@@ -438,43 +436,6 @@ register char *fn;
cp[llength(lp) - 56] = '\0';
return lgetc(lp, 2) == 'd';
}
-
-/*
- * I, a System V novice, could only figure out how to do unlinkdir()
- * and rename() as exec's of the appropriate functions. So sue me.
- * --Stephen Walton, December 1987
- */
-
-unlinkdir(f)
-char *f;
-{
- int status, pid, wpid;
-
- if ((pid = fork()) == 0)
- execl("/bin/rmdir", "rmdir", f, (char *)NULL);
- else if (pid > 0)
- while ((wpid = wait(&status)) && wpid != pid)
- ;
- else
- return FALSE;
- return status == 0;
-}
-
-Xrename(f1, f2)
-char *f1, *f2;
-{
-
- int status, pid, wpid;
-
- if ((pid = fork()) == 0)
- execl("/bin/mv", "mv", f1, f2, (char *)NULL);
- else if (pid > 0)
- while ((wpid = wait(&status)) && wpid != pid)
- ;
- else
- return FALSE;
- return status == 0;
-}
#endif NO_DIRED
struct filelist {