about summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/syslog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/misc/syslog.c b/misc/syslog.c
index 0984845699..0373ee1241 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -252,6 +252,8 @@ openlog_internal(const char *ident, int logstat, int logfac)
 			}
 		}
 		if (LogFile != -1 && !connected)
+		{
+			int old_errno = errno;
 			if (__connect(LogFile, &SyslogAddr, sizeof(SyslogAddr))
 			    == -1)
 			{
@@ -263,6 +265,7 @@ openlog_internal(const char *ident, int logstat, int logfac)
 				{
 					/* retry with next SOCK_STREAM: */
 					LogType = SOCK_STREAM;
+					__set_errno (old_errno);
 					continue;
 				}
 			} else