|
It’s in the preceding line:
> It returns the value 0 only if the command interpreter returns the value 0. A return
> value of - 1 indicates an error, and errno is set to one of the following values:
And this makes the result of -1 ambiguous, because both an error and a -1 return value from the command result in a -1 result.
I think the proper approach would be to reset `errno` before the `system` call and then check for: `stat` being -1, AND `errno` being non-0.
Thijs
|