version 1.19, 2001/07/09 07:04:49 |
version 1.20, 2001/09/21 15:08:16 |
|
|
pid_t pid; |
pid_t pid; |
int status; |
int status; |
|
|
if ((pid = vfork())) { |
switch ((pid = vfork())) { |
if (pid == -1) |
case -1: |
return -1; |
return -1; |
|
case 0: |
execl("/bin/cp", "cp", frname, toname, (char *)NULL); |
execl("/bin/cp", "cp", frname, toname, (char *)NULL); |
_exit(1); /* shouldn't happen */ |
_exit(1); /* shouldn't happen */ |
|
default: |
|
waitpid(pid, &status, 0); |
|
return (WIFEXITED(status) && WEXITSTATUS(status) == 0); |
} |
} |
waitpid(pid, &status, 0); |
|
return (WIFEXITED(status) && WEXITSTATUS(status) == 0); |
|
} |
} |
|
|
BUFFER * |
BUFFER * |