Re: [RFC PATCH 1/2] Report exec errors from run-command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Donnerstag, 24. Dezember 2009, Ilari Liusvaara wrote:
> Previously run-command was unable to report errors happening in exec
> call. Change it to pass errno from failed exec to errno value at
> return.
>
> The errno value passing can be done by opening close-on-exec pipe and
> piping the error code through in case of failure. In case of success,
> close-on-exec closes the pipe on successful exec and parent process
> gets end of file on read.

The only really *important* errno of a failed exec is ENOENT. For this case, 
wouldn't it be easier to do the PATH lookup manually in the parent (before 
the fork()), and use execv() in the forked child rather than execvp()?

There is already a path lookup function in compat/mingw.c; it could certainly 
need some improvement, but it is a starter.

That said, we don't need the stunt that you implemented on WIN32, because by 
the time mingw_spawnvpe() returns, we have a running child process.

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]