Skip to content

test: Fix stat() test to mask out unwanted bits - #3798

Merged
ethomson merged 1 commit into
libgit2:masterfrom
mmuman:stat-test-fix
May 26, 2016
Merged

test: Fix stat() test to mask out unwanted bits#3798
ethomson merged 1 commit into
libgit2:masterfrom
mmuman:stat-test-fix

Conversation

@mmuman

@mmuman mmuman commented May 24, 2016

Copy link
Copy Markdown
Contributor

Haiku and Hurd both pass extra bits in struct stat::st_mode.

@mmuman mmuman mentioned this pull request May 24, 2016
@mmuman

mmuman commented May 24, 2016

Copy link
Copy Markdown
Contributor Author

Of course win32 doesn't know about the most basic POSIX constants:

'S_IUMSK' : undeclared identifier

Should I patch src/posix.h ?

@ethomson

Copy link
Copy Markdown
Member

Neither does Linux or Mac, though. I don't think that's a POSIX thing, I think it's something Haiku invented.

@mmuman

mmuman commented May 24, 2016

Copy link
Copy Markdown
Contributor Author

Oh, indeed, I didn't check other stat headers... Linux' sys/stat.h has an ALLPERMS but ifdeffed, so I'm not sure it's always available. And mingw headers don't seem to have it. I'll just hardcode it but it's ugly.

Haiku and Hurd both pass extra bits in struct stat::st_mode.
@mmuman

mmuman commented May 24, 2016

Copy link
Copy Markdown
Contributor Author

Let's see this way...

@mmuman

mmuman commented May 24, 2016

Copy link
Copy Markdown
Contributor Author

Looks like tests passed :)

@ethomson

Copy link
Copy Markdown
Member

Looks good to me, thanks!

@ethomson
ethomson merged commit e102daa into libgit2:master May 26, 2016
@mmuman
mmuman deleted the stat-test-fix branch May 26, 2016 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants