Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
88cd81c5
Commit
88cd81c5
authored
Sep 04, 2013
by
Alexandre Duret-Lutz
Browse files
* src/misc/satsolver.cc: Report when SAT-solver terminate by signal.
parent
22f944ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/misc/satsolver.cc
View file @
88cd81c5
...
...
@@ -25,6 +25,7 @@
#include
"satsolver.hh"
#include
<fstream>
#include
<limits>
#include
<sys/wait.h>
namespace
spot
{
...
...
@@ -58,7 +59,26 @@ namespace spot
declare
(
'O'
,
out
);
std
::
ostringstream
s
;
format
(
s
,
satsolver
);
return
system
(
s
.
str
().
c_str
());
int
res
=
system
(
s
.
str
().
c_str
());
if
(
res
<
0
||
(
WIFEXITED
(
res
)
&&
WEXITSTATUS
(
res
)
==
127
))
{
s
<<
": failed to execute"
;
throw
std
::
runtime_error
(
s
.
str
());
}
// For POSIX shells, "The exit status of a command that
// terminated because it received a signal shall be reported
// as greater than 128."
if
(
WIFEXITED
(
res
)
&&
WEXITSTATUS
(
res
)
>=
128
)
{
s
<<
": terminated by signal"
;
throw
std
::
runtime_error
(
s
.
str
());
}
if
(
WIFSIGNALED
(
res
))
{
s
<<
": terminated by signal "
<<
WTERMSIG
(
res
);
throw
std
::
runtime_error
(
s
.
str
());
}
return
res
;
}
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment