diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-06 16:40:31 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-06 16:40:31 +0000 |
commit | 830646f3725527e5c101f0e53e4c02ba2300df52 (patch) | |
tree | 500777403438b4f167363f19d1200e0ea57902d6 /lib | |
parent | d6187531cf89e57b2c39a2b83c4aed8ca1268b79 (diff) |
Fix detection of filesystems without extended attribute support on NetBSD.
NetBSD (version 6) uses ENOTSUP as the errno code to indicate missing support
for extended attribute in the filesystem. This appears to be at odds with other
Unixes: https://mail-index.netbsd.org/tech-kern/2011/12/13/msg012185.html
We need to detect and handle ENOTSUP to stop the backup daemon from killing
itself while trying to read extended attributes from the first file in the
backup set.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backupstore/BackupClientFileAttributes.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/backupstore/BackupClientFileAttributes.cpp b/lib/backupstore/BackupClientFileAttributes.cpp index 53215b7c..e331e107 100644 --- a/lib/backupstore/BackupClientFileAttributes.cpp +++ b/lib/backupstore/BackupClientFileAttributes.cpp @@ -654,9 +654,18 @@ void BackupClientFileAttributes::FillExtendedAttr(StreamableMemBlock &outputBloc } else if(listSize<0) { - if(errno == EOPNOTSUPP || errno == EACCES) + if(errno == EOPNOTSUPP || errno == EACCES +#if HAVE_DECL_ENOTSUP + // NetBSD uses ENOTSUP instead + // https://mail-index.netbsd.org/tech-kern/2011/12/13/msg012185.html + || errno == ENOTSUP +#endif + ) { - // fail silently + // Not supported by OS, or not on this filesystem + BOX_TRACE(BOX_SYS_ERRNO_MESSAGE(errno, + BOX_FILE_MESSAGE(Filename, "Failed to " + "list extended attributes"))); } else if(errno == ERANGE) { @@ -673,7 +682,7 @@ void BackupClientFileAttributes::FillExtendedAttr(StreamableMemBlock &outputBloc else { THROW_SYS_FILE_ERROR("Failed to list extended " - "attributes, skipping them", Filename, + "attributes for unknown reason", Filename, CommonException, OSFileError); } } |