Kaydet (Commit) 6b7561a8 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1195349 Argument cannot be negative

Change-Id: Id0a8bac3c14e668f066ddcafc84d3397c0d9b74f
üst 1397b0a9
...@@ -106,6 +106,8 @@ void glxtest() ...@@ -106,6 +106,8 @@ void glxtest()
// any PR logging file descriptors. To that effect, we redirect all positive // 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. // file descriptors up to what open() returns here. In particular, 1 is stdout and 2 is stderr.
int fd = open("/dev/null", O_WRONLY); int fd = open("/dev/null", O_WRONLY);
if (fd == -1)
fatal_error("could not redirect stdout+stderr");
for (int i = 1; i < fd; i++) for (int i = 1; i < fd; i++)
dup2(fd, i); dup2(fd, i);
close(fd); close(fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment