[haiku-development] Re: BFS reporting S_STR_INDEX in stat::st_mode for directories

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 23 May 2016 10:12:57 +0200

Am 23.05.2016 um 00:40 schrieb François Revol:

I've been porting libgit2:
https://github.com/libgit2/libgit2/pull/3796

Appart from their test suite calling inet_pton() with dst=NULL which
asserts, it seems they have some picky checks on the filesystem.

One of them complains that the st_mode field is not what it expects:

  st.st_mode != (GIT_FILEMODE_TREE | 0701) & ~um
  100040701 != 0040701

It actually seems like BFS is reporting S_STR_INDEX in addition to S_IFDIR.
Is this intended?

Yes, it is, at least I put that in there intentionally, since the original BFS does this as well. Also, it's actually used when opening any B+tree -- we could do without it, though, if absolutely needed.

Their test could probably use the S_IFMT mask but well...

That's what this is for, at least -- I'd say their test is broken :-)

However, it looks like they mix their own constants (GIT_FILEMODE_TREE) into st_mode which isn't really that platform independent, and might be what the test is actually there for?

Bye,
   Axel.

Other related posts: