]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
terminal-util: no real reason to assert on O_CREAT 845/head
authorLennart Poettering <lennart@poettering.net>
Mon, 3 Aug 2015 17:06:01 +0000 (19:06 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 3 Aug 2015 17:07:33 +0000 (19:07 +0200)
That's just handle this as a normal error.

src/basic/terminal-util.c

index f4c7489e09c9d33baea9a1528fb703b580fcbc15..cf55263bbfe985c8c0f62927110c36e2624739b2 100644 (file)
@@ -308,7 +308,8 @@ int open_terminal(const char *name, int mode) {
          * https://bugs.launchpad.net/ubuntu/+source/linux/+bug/554172/comments/245
          */
 
-        assert(!(mode & O_CREAT));
+        if (mode & O_CREAT)
+                return -EINVAL;
 
         for (;;) {
                 fd = open(name, mode, 0);