[PATCH] D30736: [Support] Add support for getting file system permissions on Windows and implement sys::fs::permissions to set them

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 07:57:05 PDT 2017


jhenderson added a comment.

In https://reviews.llvm.org/D30736#699157, @aaron.ballman wrote:

> In https://reviews.llvm.org/D30736#699146, @aaron.ballman wrote:
>
> > LGTM as well; I've commit in r297617, thank you!
>
>
> I had to revert, as this broke at least one of the bots: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/49970


I'm just verifying a fix locally, but it turns out the problem is that on Linux, the file type is encoded in the st_mode field of the stat struct, but is not removed when setting the permissions value. As a result, the getter gets a value with the S_IFREG still set. My plan is to remove this bit (and all other file type bits) when the value is set in getStatus, so that the getter only cares about the permissions as defined in the perms enum. I didn't spot the issue previously because I did not realise that the unit tests were not being built on Linux.


https://reviews.llvm.org/D30736





More information about the llvm-commits mailing list