[llvm] r185832 - Create files with the correct permission instead of changing it afterwards.

Stephen Checkoway s at pahtak.org
Mon Jul 15 15:38:56 PDT 2013


On Jul 15, 2013, at 6:24 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

> On 15 July 2013 17:25, Stephen Checkoway <s at pahtak.org> wrote:
>> 
>> On Jul 15, 2013, at 4:38 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
>> 
>>> Attached. What do you think?
>> 
>>> +  // Verify that we don't have both "append" and "excl".
>>> +  assert((!(Flags & sys::fs::F_Excl) || !(Flags & sys::fs::F_Append)) &&
>>> +         "Cannot specify both 'excl' and 'append' file creation flags!");
>> 
>> Append and excl probably needn't be mutually exclusive. It's perfectly reasonable to open a file with both, although perhaps you have reason to disallow that here that I don't see.
> 
> I just moved this code from raw_fd_ostream.  Would you mind if I
> removed it in another patch?

I have no final say on anything, I just noticed it. I guess I didn't read closely enough to see that it came from from elsewhere though.

> 
>>> +  error_code EC = sys::fs::openFileForWrite(Filename, FD, Flags, 0664);
>> 
>> Why 0664 and not 0666? Shouldn't the users umask determine determine the actual permissions? If I have 0000, I'd be surprised by a file produced with permissions 0664. E.g.,
> 
> I agree, we should use 0666, but it is probably better to do that in
> another patch, no?


Probably true.

-- 
Stephen Checkoway









More information about the llvm-commits mailing list