Commit a0bf5a4e authored by sebastian@ifyouwantblood.de's avatar sebastian@ifyouwantblood.de
Browse files

bug 1400839 use -1 instead of 0 to indicate absent glxtest_pipe fd r=karlt

Englightenment closes fd 0 on child processes and so pipe() can return a zero fd.

MozReview-Commit-ID: 5d9xQXgwgfv

--HG--
extra : rebase_source : c31aa7ce731ba325993f463b79b446ae67c932dd
parent bae8112f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug)
#endif

// these global variables will be set when firing the glxtest process
int glxtest_pipe = 0;
int glxtest_pipe = -1;
pid_t glxtest_pid = 0;

nsresult
@@ -55,8 +55,8 @@ GfxInfo::GetData()
    // to understand this function, see bug 639842. We retrieve the OpenGL driver information in a
    // separate process to protect against bad drivers.

    // if glxtest_pipe == 0, that means that we already read the information
    if (!glxtest_pipe)
    // if glxtest_pipe == -1, that means that we already read the information
    if (glxtest_pipe == -1)
        return;

    enum { buf_size = 1024 };
@@ -65,7 +65,7 @@ GfxInfo::GetData()
                             &buf,
                             buf_size-1); // -1 because we'll append a zero
    close(glxtest_pipe);
    glxtest_pipe = 0;
    glxtest_pipe = -1;

    // bytesread < 0 would mean that the above read() call failed.
    // This should never happen. If it did, the outcome would be to blacklist anyway.