From 6b7561a87a8c1f99d56da71fa222efb178ffc1aa Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 24 Nov 2014 09:26:35 +0000 Subject: coverity#1195349 Argument cannot be negative Change-Id: Id0a8bac3c14e668f066ddcafc84d3397c0d9b74f --- vcl/unx/glxtest.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx index d1f959163ea9..9e2fba476bd2 100644 --- a/vcl/unx/glxtest.cxx +++ b/vcl/unx/glxtest.cxx @@ -106,6 +106,8 @@ void glxtest() // any PR logging file descriptors. To that effect, we redirect all positive // file descriptors up to what open() returns here. In particular, 1 is stdout and 2 is stderr. int fd = open("/dev/null", O_WRONLY); + if (fd == -1) + fatal_error("could not redirect stdout+stderr"); for (int i = 1; i < fd; i++) dup2(fd, i); close(fd); -- cgit