summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-04-22 14:46:48 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-04-22 14:46:48 -0400
commit9ea68828f31d5be1f6622321464533b35dd6d762 (patch)
treebf22b890b3972b51cb3de4de4c47e5d2af1ec8c7 /lib
parentd3395ae71a38ff562e0af3a174ecbc5b523057d6 (diff)
downloade2fsprogs-9ea68828f31d5be1f6622321464533b35dd6d762.tar.gz
libss: ss_execute_line: reflect any error codes from system() to the caller
This is primarily to silence a gcc warning, but it's better to reflect the error from system() up to the caller. In this case we don't actually use it for anything, but that's OK. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib')
-rw-r--r--lib/ss/execute_cmd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ss/execute_cmd.c b/lib/ss/execute_cmd.c
index e9c65f6d..bc2a2046 100644
--- a/lib/ss/execute_cmd.c
+++ b/lib/ss/execute_cmd.c
@@ -14,6 +14,11 @@
#ifdef HAS_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#else
+extern int errno;
+#endif
#include "ss_internal.h"
#include <stdio.h>
@@ -213,8 +218,7 @@ int ss_execute_line (sci_idx, line_ptr)
return SS_ET_ESCAPE_DISABLED;
else {
line_ptr++;
- system(line_ptr);
- return 0;
+ return (system(line_ptr) < 0) ? errno : 0;
}
}