From: Christian Brauner Date: Wed, 28 Jul 2021 15:25:38 +0000 (+0200) Subject: terminal: ttyname_r() returns an error number on failure X-Git-Tag: lxc-5.0.0~131^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecfc18270e2f532cc6f4c67cfb2dbba1a4e870b3;p=thirdparty%2Flxc.git terminal: ttyname_r() returns an error number on failure In other words, how inconsistent can an API be? Signed-off-by: Christian Brauner --- diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c index 2c73c8f27..8850a9687 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -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; }