Skip to content

Commit c60cf34

Browse files
committed
Handle ENOATTR and ENODATA separately
Some platforms define both of them, some define only one of them.
1 parent 8d0b5a0 commit c60cf34

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

sources/fuse_high_level_ops_base.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,17 @@ int FuseHighLevelOpsBase::static_getxattr(
287287
}
288288
catch (const ExceptionBase& e)
289289
{
290-
#if defined(ENOATTR) && defined(ENODATA)
291-
// This happens so frequently that we don't want to log it.
292290
auto err = e.error_number();
293-
if (err == ENOATTR || err == ENODATA)
291+
#ifdef ENOATTR
292+
// This happens so frequently that we don't want to log it.
293+
if (err == ENOATTR)
294+
{
295+
return -err;
296+
}
297+
#endif
298+
#ifdef ENODATA
299+
// This happens so frequently that we don't want to log it.
300+
if (err == ENODATA)
294301
{
295302
return -err;
296303
}

0 commit comments

Comments
 (0)