From 076e26f92e4e24feae68d42f5e2f48f1933f8048 Mon Sep 17 00:00:00 2001 From: szaka Date: Sun, 8 Jul 2007 20:47:48 +0000 Subject: [PATCH] ntfs_log_handler_syslog(): don't lose errno in an error path --- libntfs-3g/logging.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libntfs-3g/logging.c b/libntfs-3g/logging.c index f156e6a7..90a20cf1 100644 --- a/libntfs-3g/logging.c +++ b/libntfs-3g/logging.c @@ -365,7 +365,8 @@ int ntfs_log_handler_syslog(const char *function __attribute__((unused)), ret = vsnprintf(log, LOG_LINE_LEN, format, args); if (ret < 0) { vsyslog(LOG_NOTICE, format, args); - return 1; + ret = 1; + goto out; } if ((LOG_LINE_LEN > ret + 3) && (level & NTFS_LOG_LEVEL_PERROR)) { @@ -375,7 +376,7 @@ int ntfs_log_handler_syslog(const char *function __attribute__((unused)), } syslog(LOG_NOTICE, "%s", log); - +out: errno = olderr; return ret; }