bug-gnulib
[Top][All Lists]
Advanced

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

waitpid and warn_unused_result


From: Eric Blake
Subject: waitpid and warn_unused_result
Date: Mon, 24 Oct 2011 15:47:53 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15

Any objections to making the gnulib <sys/wait.h> apply the gcc warn_unused_result attribute to waitpid(), even though glibc does not (yet) do likewise? After all, if you fail to check for failures on this syscall (particularly EINTR failures, where you should normally repeat the waitpid() call), you can end up leaking unreaped child processes, which is a rather nasty resource leak to debug.

I ask this because Coverity was complaining about a couple places where libvirt was calling waitpid() and ignoring the return value.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]