This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH v3] linux: open and openat ignore 'mode' with O_TMPFILE in flags
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "Eric Rannaud" <e at nanocritical dot com>
- Cc: libc-alpha at sourceware dot org, joseph at codesourcery dot com, Florian Weimer <fw at deneb dot enyo dot de>
- Date: Thu, 6 Nov 2014 14:39:38 -0800 (PST)
- Subject: Re: [PATCH v3] linux: open and openat ignore 'mode' with O_TMPFILE in flags
- Authentication-results: sourceware.org; auth=none
- References: <01b1f134d2fd5f0e5a5c5c8742819b0988504d3a dot 1415306586 dot git dot e at nanocritical dot com>
> + * io/fcntl.h: Define __OPEN_NEEDS_MODE.
* io/fcntl.h (__OPEN_NEEDS_MODE): New macro.
> + * io/bits/fcntl2.h (open): Use __OPEN_NEEDS_MODE.
Appearing right after the first line, this can say just "Use it." That's
shorter, but there is nothing wrong with being explicit as you were.
> +#ifdef __O_TMPFILE
> +# define __OPEN_NEEDS_MODE(oflag) \
> + ( ((oflag) & O_CREAT) != 0 || ((oflag) & __O_TMPFILE) == __O_TMPFILE )
> +# define __OPEN_NEEDS_MODE(oflag) ( ((oflag) & O_CREAT) != 0 )
Drop the extra spaces around the parens. We use a space between an
identifier (or keyword) and an open-paren, but not after an open-paren or
before a close-paren.
> /* Open FILE and return a new file descriptor for it, or -1 on error.
> - OFLAG determines the type of access used. If O_CREAT is on OFLAG,
> - the third argument is taken as a `mode_t', the mode of the created file.
> + OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is on
> + OFLAG, the third argument is taken as a `mode_t', the mode of the created
> + file.
The old text had this problem before, but it's always good to clean up
verbiage while you're there: "is on OFLAG" should be "is set in OFLAG".
With those cosmetic nits fixed, this change is fine to go in now on its
substance. I don't see copyright paperwork from you. Have you begun the
process with the FSF already or do you not know what I'm talking about?
We'll need the assignment in place before we can accept your patch (which
we'd very much like to accept now!).