tst_rod: Fix error propagation on 'command not found'
PATCH 1/1 tst_rod: Fix error propagation on 'command not found'
In a case that we try to execute nonexistent command we end up with 'command not found' in the test logs but the error is actually ignored. That is because the pclose() returns the value as returned by wait() so some of the upper bits are cleared on return from the main().
Since we are not actually using the return value for anything, we only do tst_brk if it's non-zero we may as well normalize it with double negation, which is what this patch does.
Signed-off-by Cyril Hrubis <[email protected]>
--- testcases/lib/tst_rod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/lib/tst_rod.c +1 -1
@@ -162,5 +162,5 @@ int main(int argc, char *argv[])for (i =0 ; args[i]; i++)fprintf (sin,"%s " , args[i]); -return pclose (sin); +return !!pclose (sin); }
Signature · 1 line
2.13.6