summaryrefslogtreecommitdiff
path: root/src/libudev/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-07-17 02:52:41 +0200
committerAnthony G. Basile <blueness@gentoo.org>2013-08-02 20:52:08 -0400
commitfdcb20a34f15fb29d9ab4ff6321a1cb42aca2287 (patch)
tree593a8c6e0937b96f68ab7fd2d7f8470cf7774d61 /src/libudev/util.c
parenta3cd924ecba40190703919285f5e2ef559d32ccd (diff)
util: make gcc shut up by passing a 0 mode param to open()
If we pass a variable to open()'s flags parameter it really wants a mode parameter too, otherwise some gcc version whine. Hence, pass 0 in that case.
Diffstat (limited to 'src/libudev/util.c')
-rw-r--r--src/libudev/util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libudev/util.c b/src/libudev/util.c
index 10a786368e..ad16df83dd 100644
--- a/src/libudev/util.c
+++ b/src/libudev/util.c
@@ -618,8 +618,10 @@ int open_terminal(const char *name, int mode) {
* https://bugs.launchpad.net/ubuntu/+source/linux/+bug/554172/comments/245
*/
+ assert(!(mode & O_CREAT));
+
for (;;) {
- fd = open(name, mode);
+ fd = open(name, mode, 0);
if (fd >= 0)
break;