Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> --- git-compat-util.h | 1 + usage.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index e8f2867..f2bd775 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -398,6 +398,7 @@ extern NORETURN void usagef(const char *err, ...) __attribute__((format (printf, extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 1, 2))); extern NORETURN void die_errno(const char *err, ...) __attribute__((format (printf, 1, 2))); extern int error(const char *err, ...) __attribute__((format (printf, 1, 2))); +extern int sys_error(const char *err, ...) __attribute__((format (printf, 1, 2))); extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2))); #ifndef NO_OPENSSL diff --git a/usage.c b/usage.c index 0dba0c5..e7c37f2 100644 --- a/usage.c +++ b/usage.c @@ -148,6 +148,16 @@ void NORETURN die_errno(const char *fmt, ...) va_end(params); } +int sys_error(const char *fmt, ...) +{ + va_list params; + + va_start(params, fmt); + error_routine(fmt_with_err(fmt), params); + va_end(params); + return -1; +} + #undef error int error(const char *err, ...) { -- 2.7.0.377.g4cd97dd -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html