On Wed, Oct 19, 2022 at 3:05 PM Gerald Pfeifer gerald@pfeifer.com wrote:
On Wed, 19 Oct 2022, Erich E. Hoover wrote:
It looks like this just got merged. Gerald, would you check and see if ENOATTR is defined on your system?
I checked, and FreeBSD (12 and 14, so current and future versions) both define ENOATTR guarded by #ifndef _POSIX_SOURCE, so generally available.
This commit removes the compile warning
It actually was hard build error.
Yes, sorry - I misspoke.
but you're going to get a lot of unnecessary console warnings ("attribute does not exist" is not an error here).
Is it possible Alexandre's adjusted version of my submission avoids this? ...
No. If the filesystem supports extended attributes (!ENOTSUP) then you will get an error if there aren't any xattr for the file. I suspect that we either want: === #ifdef ENODATA if (errno == ENODATA) return ret; #endif #ifdef ENOATTR if (errno == ENOATTR) return ret; #endif ===
Or we want to do something like this: === #ifndef ENOATTR #define ENOATTR ENODATA #endif === and then check against ENOATTR instead (little bit of research says that platforms that define both use ENOATTR in this case).
Best, Erich