summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-24 09:26:35 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-24 09:38:54 +0000
commit6b7561a87a8c1f99d56da71fa222efb178ffc1aa (patch)
treea1cb26dae8d4dcde5dc37e7135c439db34b5202b /vcl
parent1397b0a9e6f46a93aabca498ba26ed74ee96ef0d (diff)
coverity#1195349 Argument cannot be negative
Change-Id: Id0a8bac3c14e668f066ddcafc84d3397c0d9b74f
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/glxtest.cxx2
1 files changed, 2 insertions, 0 deletions
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);