summaryrefslogtreecommitdiff
path: root/glnx-fdio.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2017-05-19 11:26:55 +0200
committerAlexander Larsson <alexl@redhat.com>2017-05-19 11:26:55 +0200
commitafffc256a09f86e1bcfde08d2b5081558ffe0816 (patch)
tree6a5e7a258d286a7dd3a9bd02b96d37c1f75d4adc /glnx-fdio.h
parent4fbd48fb88906b3eaa9de31c6c798c4f15ee05a4 (diff)
downloadlibglnx-afffc256a09f86e1bcfde08d2b5081558ffe0816.tar.gz
fdio: Allow using AT_FDCWD with GlnxTmpfilewip/alexl/fix-tmpfiles
We use fd >= 0 to check for validity instead of src_dfd >= 0 because everything works just fine with src_dfd == AT_FDCWD, except that is negative so the checks break. This fixes flatpak which uses AT_FDCWD.
Diffstat (limited to 'glnx-fdio.h')
-rw-r--r--glnx-fdio.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/glnx-fdio.h b/glnx-fdio.h
index cc36ca4..cccad57 100644
--- a/glnx-fdio.h
+++ b/glnx-fdio.h
@@ -53,7 +53,7 @@ typedef struct {
int fd;
char *path;
} GLnxTmpfile;
-#define GLNX_TMPFILE_INIT { .src_dfd = -1 };
+#define GLNX_TMPFILE_INIT { .fd = -1 };
void glnx_tmpfile_clear (GLnxTmpfile *tmpf);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxTmpfile, glnx_tmpfile_clear);