From 3b2a002cdf9548bd68ee80d3b9532fd7f5b3167d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 27 Feb 2000 06:02:36 +0000 Subject: Remove a now-bogus comment Use pid_t Use vfork(), not fork() when sensible --- usr.bin/mg/fileio.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'usr.bin/mg/fileio.c') diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c index 6c42a013a27..b50758d817c 100644 --- a/usr.bin/mg/fileio.c +++ b/usr.bin/mg/fileio.c @@ -327,27 +327,13 @@ notfound: #include #include "kbd.h" -/* - * It's sort of gross to call system commands in a subfork. However - * that's by far the easiest way. These things are used only in - * dired, so they are not performance-critical. The cp program is - * almost certainly faster at copying files than any stupid code that - * we would write. In fact there is no other way to do unlinkdir. - * You don't want to do a simple unlink. To do the whole thing in - * a general way requires root, and rmdir is setuid. We don't really - * want microemacs to have to run setuid. rename is easy to do with - * unlink, link, unlink. However that code will fail if the destination - * is on a different file system. mv will copy in that case. It seems - * easier to let mv worry about this stuff. - */ - copy(frname, toname) char *frname, *toname; { - int pid; + pid_t pid; int status; - if(pid = fork()) { + if(pid = vfork()) { if(pid == -1) return -1; execl("/bin/cp", "cp", frname, toname, (char *)NULL); _exit(1); /* shouldn't happen */ -- cgit v1.2.3