diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-07-17 18:13:20 +0900 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-07-17 18:13:20 +0900 |
| commit | da9794e272edbceda7dcc268f1a9c44ce97f73b1 (patch) | |
| tree | 86eb598130da337a6c24e577891cc4151972a06c /src/assert.cc | |
| parent | a9455bf13259080233f1f2f13c034615363e532c (diff) | |
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.
Diffstat (limited to 'src/assert.cc')
| -rw-r--r-- | src/assert.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/assert.cc b/src/assert.cc index 5f8a3f9d..4b7c180a 100644 --- a/src/assert.cc +++ b/src/assert.cc @@ -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 } |
