]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
terminal: ttyname_r() returns an error number on failure
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 28 Jul 2021 15:25:38 +0000 (17:25 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 28 Jul 2021 16:40:13 +0000 (18:40 +0200)
In other words, how inconsistent can an API be?

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/terminal.c

index 2c73c8f27841aa36c7e1376da337024a07b54816..8850a968718f839ea325acb809e5620c8013bb04 100644 (file)
@@ -950,7 +950,7 @@ static int lxc_terminal_create_native(const char *name, const char *lxcpath, str
        }
 
        ret = ttyname_r(terminal->pty, terminal->name, sizeof(terminal->name));
-       if (ret < 0) {
+       if (ret) {
                SYSWARN("Failed to retrieve name of terminal pty");
                goto err;
        }