From: Theodore Ts'o Date: Wed, 22 Apr 2009 18:46:48 +0000 (-0400) Subject: libss: ss_execute_line: reflect any error codes from system() to the caller X-Git-Tag: v1.41.5~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ea68828f31d5be1f6622321464533b35dd6d762;p=thirdparty%2Fe2fsprogs.git 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" --- diff --git a/lib/ss/execute_cmd.c b/lib/ss/execute_cmd.c index e9c65f6de..bc2a20464 100644 --- a/lib/ss/execute_cmd.c +++ b/lib/ss/execute_cmd.c @@ -14,6 +14,11 @@ #ifdef HAS_STDLIB_H #include #endif +#ifdef HAVE_ERRNO_H +#include +#else +extern int errno; +#endif #include "ss_internal.h" #include @@ -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; } }