diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-02-27 06:02:36 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-02-27 06:02:36 +0000 |
commit | 3b2a002cdf9548bd68ee80d3b9532fd7f5b3167d (patch) | |
tree | 6bfbafaa75b82a10172cf11404bb7c0ed9e13932 /usr.bin/mg/fileio.c | |
parent | 25c0c4e7eb2c5c668b06487d71803586771974b8 (diff) |
Remove a now-bogus comment
Use pid_t
Use vfork(), not fork() when sensible
Diffstat (limited to 'usr.bin/mg/fileio.c')
-rw-r--r-- | usr.bin/mg/fileio.c | 18 |
1 files changed, 2 insertions, 16 deletions
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 <sys/wait.h> #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 */ |