[BusyBox] Re: busybox-cvs Digest, Vol 2, Issue 13
Vladimir N. Oleynik
dzo at simtreas.ru
Tue May 27 12:57:14 UTC 2003
Erik,
> Update of /var/cvs/busybox/libbb
> In directory winder:/tmp/cvs-serv12876/libbb
>
> Modified Files:
> run_parts.c
> Log Message:
> This was doing some silly stuff that is not necessary when using
> vfork(), so I have simplified it.
>
>
> Index: run_parts.c
> ===================================================================
> RCS file: /var/cvs/busybox/libbb/run_parts.c,v
> retrieving revision 1.6
> retrieving revision 1.7
> diff -u -d -r1.6 -r1.7
> --- run_parts.c 19 Mar 2003 09:12:08 -0000 1.6
> +++ run_parts.c 26 May 2003 18:12:00 -0000 1.7
> @@ -83,31 +83,37 @@
> if (test_mode & 1) {
> puts(filename);
> } else {
> - /* exec_errno is common vfork variable */
> - volatile int exec_errno = 0;
> + pid_t pid, wpid;
> int result;
> - int pid;
>
> if ((pid = vfork()) < 0) {
> bb_perror_msg_and_die("failed to fork");
> - } else if (!pid) {
> - args[0] = filename;
> + } else if (pid==0) {
> execv(filename, args);
> - exec_errno = errno;
> _exit(1);
> }
>
> - waitpid(pid, &result, 0);
> - if(exec_errno) {
> - errno = exec_errno;
> - bb_perror_msg_and_die("failed to exec %s", filename);
> - }
Why? :-0
I use this trick for can show:
("failed exec with %s", streerror(errno))
--w
vodz
More information about the busybox
mailing list