summaryrefslogtreecommitdiff
path: root/glnx-fdio.h
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-06-13 16:22:09 -0400
committerColin Walters <walters@verbum.org>2017-06-14 12:48:20 -0400
commit9a1b77ef96b4eb9a916a71e7a04055c4c5665dea (patch)
treec89856b6f755aae9b17167ed184d9d0ddc7b41df /glnx-fdio.h
parent05abf2143f967cd85b1b1b777ee412a581979cf1 (diff)
downloadlibglnx-9a1b77ef96b4eb9a916a71e7a04055c4c5665dea.tar.gz
Add G_IN_SET, patch our internal users via spatch
I originally tried to get this into GLib: https://bugzilla.gnome.org/show_bug.cgi?id=783751 But that looks like it's going to fail due to MSVC. Let's add it here at least so I can start using it tomorrow and not wait for the MSVC team to catch up. I renamed `glnx-alloca.h` to `glnx-macros.h` as a more natural collective home for things from systemd's `macro.h`. Finally, I used a Coccinelle spatch similar to the one referenced in the above BZ to patch our uses.
Diffstat (limited to 'glnx-fdio.h')
-rw-r--r--glnx-fdio.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/glnx-fdio.h b/glnx-fdio.h
index e52c823..95574bd 100644
--- a/glnx-fdio.h
+++ b/glnx-fdio.h
@@ -35,6 +35,7 @@
#include <libgen.h>
#undef basename
+#include <glnx-macros.h>
#include <glnx-errors.h>
G_BEGIN_DECLS
@@ -189,7 +190,7 @@ glnx_try_fallocate (int fd,
if (fallocate (fd, 0, offset, size) < 0)
{
- if (errno == ENOSYS || errno == EOPNOTSUPP)
+ if (G_IN_SET(errno, ENOSYS, EOPNOTSUPP))
; /* Ignore */
else
return glnx_throw_errno_prefix (error, "fallocate");