Fix xmessage handling in assert.cc

The return value of the system call is not directly the exit value
of the process, but a status that needs to be inspected with some
macros.
This commit is contained in:
Maxime Coste 2017-07-17 18:13:20 +09:00
parent a9455bf132
commit da9794e272

View File

@ -32,7 +32,8 @@ bool notify_fatal_error(StringView msg)
MB_OKCANCEL | MB_ICONERROR) == IDOK;
#elif defined(__linux__)
auto cmd = format("xmessage -buttons 'quit:0,ignore:1' '{}'", msg);
return system(cmd.c_str()) == 1;
int status = system(cmd.c_str());
return (WIFEXITED(status)) ? (WEXITSTATUS(status)) == 1 : false;
#endif
}