On 06/09/2010 09:04 AM, Jakub Hrozek wrote:
-----BEGIN PGP SIGNED MESSAGE-----
On 06/09/2010 02:02 PM, Stephen Gallagher wrote:
> Thanks, new patch attached.
One more comment, in get_uid_from_pid():
+ DEBUG(1, ("read failed [%d][%s].\n", errno, +strerror(errno)));
+ return errno;
I think you should save errno somewhere, otherwise it will be
overwritten by printf() in the DEBUG() call.
I'm attaching a second patch to handle this, as errno is misused
throughout that entire file. This patch applies atop the read/write patch.
Otherwise looks OK, although I'm wondering whether it makes sense
have some kind of macro for loops around read() or write().
It wasn't worth writing a macro because we handle the loops differently
in different places. In some places we exit back to the mainloop and
wait for the tevent_fd handler to call us again, in other places we loop
tightly, and in yet other places we are copying data from a read buffer
into a write buffer.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.