Displaying 2 results from an estimated 2 matches for "file_is_enotsup".
2019 Aug 13
0
[nbdkit PATCH 2/2] plugins: Permit ENOTSUP as synonym for EOPNOTSUPP
...would be
diff --git a/plugins/file/file.c b/plugins/file/file.c
index 9df5001d..a9d6491a 100644
--- a/plugins/file/file.c
+++ b/plugins/file/file.c
@@ -73,6 +73,12 @@ static pthread_mutex_t lseek_lock = PTHREAD_MUTEX_INITIALIZER;
/* to enable: -D file.zero=1 */
int file_debug_zero;
+static bool
+file_is_enotsup (int err)
+{
+ return err == ENOTSUP || err == EOPNOTSUPP;
+}
+
static void
file_unload (void)
{
@@ -399,7 +405,7 @@ file_zero (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
goto out;
}
- if (errno != EOPNOTSUPP) {
+ if (!file_is_enotsup (errno)) {
nbd...
2019 Aug 13
3
[nbdkit PATCH 0/2] errno cleanup patches
I ran into these while trying to prepare patches to add
NBD_CMD_FLAG_FAST_ZERO, which will expose a new NBD_ENOTSUP wire
value.
Eric Blake (2):
plugins: Don't lose original error when emulating FUA
plugins: Permit ENOTSUP as synonym for EOPNOTSUPP
docs/nbdkit-filter.pod | 11 ++++++-----
docs/nbdkit-plugin.pod | 12 +++++++-----
plugins/file/file.c | 16 +++++++++++-----