blob: 88f5d88c2e164788811df73f4af660d291a7c4ea (
plain) (
tree)
|
|
commit a0bf5a4eff67
Author: sebastian@ifyouwantblood.de <sebastian@ifyouwantblood.de>
Date: Tue Sep 19 11:47:12 2017 +1200
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
---
widget/GfxInfoX11.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git widget/GfxInfoX11.cpp widget/GfxInfoX11.cpp
index bf99367d084b..8bb54a99136f 100644
--- widget/GfxInfoX11.cpp
+++ widget/GfxInfoX11.cpp
@@ -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.
|