Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
---
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 4743954..e8e7765 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -412,6 +412,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.8.0.rc0.210.gd302cd2
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html