From: Karel Zak Date: Tue, 14 Jul 2020 09:43:38 +0000 (+0200) Subject: test_tiocsti: check ioctl() return code [coverity scan] X-Git-Tag: v2.36~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f596692030ad106444ee83aa9a944cd32dc1436a;p=thirdparty%2Futil-linux.git test_tiocsti: check ioctl() return code [coverity scan] Signed-off-by: Karel Zak --- diff --git a/tests/helpers/test_tiocsti.c b/tests/helpers/test_tiocsti.c index c269dc037b..c2213f506a 100644 --- a/tests/helpers/test_tiocsti.c +++ b/tests/helpers/test_tiocsti.c @@ -17,11 +17,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include #include int main(void) { - char *cmd = "id -u -n\n"; - while(*cmd) - ioctl(0, TIOCSTI, cmd++); + int rc = 0; + char *cmd = "id -u -n\n"; + + while(*cmd) + rc += ioctl(0, TIOCSTI, cmd++); + + exit(rc ? EXIT_FAILURE : EXIT_SUCCESS); }