On 03/29/2010 06:23 PM, James Youngman wrote:
> * configure.ac: Check for <sys/resource.h> and the getrusage
> function.
> * lib/fdleak.c: Don't #include <sys/resource.h> if we don't have it.
> (get_max_fd): If neither /proc/self/fd not getrusage is available,
> return _POSIX_OPEN_MAX.
> (remember_non_cloexec_fds): Also check for leaks in file
> descriptors 0, 1, 2, just in case the caller closed them.
> (find_first_leaked_fd): Likewise.
> (open_cloexec): Make sure we are not creating a file (for some odd
> system where O_CREAT is 0).

O_CREAT _cannot_ be 0.

> @@ -298,6 +300,10 @@ open_cloexec (const char *path, int flags)
>  {
>    int fd;
>  
> +  /* Make sure we don't accidentally create a file, since we
> +   * aren't passing a mode argument. */
> +  assert ((flags & O_CREAT) == 0);

But this is still the right thing to do, so it is only a misleading
comment in the commit log.

-- 
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Findutils-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/findutils-patches

Reply via email to