chiark / gitweb /
terminal-util: no real reason to assert on O_CREAT
authorLennart Poettering <lennart@poettering.net>
Mon, 3 Aug 2015 17:06:01 +0000 (19:06 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:18:46 +0000 (10:18 +0100)
That's just handle this as a normal error.

src/basic/terminal-util.c

index 43510f481dfa359cb9e6464555ea1ea10471117d..28ae5dc08bd9dd0ff8e6269909e8ef6c729036c2 100644 (file)
@@ -311,7 +311,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);