[Top][All Lists]

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

Re: [PATCH] Apply bugfixes and suggestions from Eric's comments.

From: Eric Blake
Subject: Re: [PATCH] Apply bugfixes and suggestions from Eric's comments.
Date: Tue, 30 Mar 2010 07:45:05 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3

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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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