summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/misc.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2017-12-08 02:14:34 +0000
committerDamien Miller <djm@cvs.openbsd.org>2017-12-08 02:14:34 +0000
commitab3efe553a2eb52f8f0de14794050c91b2831c43 (patch)
treed50f757612b4ab224622803d107ade14152ce9a7 /usr.bin/ssh/misc.c
parent77e0d9e84dabdde05348ac6246133ffe5d70ad4d (diff)
fix ordering in previous to ensure errno isn't clobbered before
logging.
Diffstat (limited to 'usr.bin/ssh/misc.c')
-rw-r--r--usr.bin/ssh/misc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/ssh/misc.c b/usr.bin/ssh/misc.c
index ca1673833b3..c1ad2dc3a77 100644
--- a/usr.bin/ssh/misc.c
+++ b/usr.bin/ssh/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.121 2017/12/08 02:13:02 djm Exp $ */
+/* $OpenBSD: misc.c,v 1.122 2017/12/08 02:14:33 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -1451,18 +1451,18 @@ unix_listener(const char *path, int backlog, int unlink_first)
}
if (bind(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0) {
saved_errno = errno;
- close(sock);
error("%s: cannot bind to path %s: %s",
__func__, path, strerror(errno));
+ close(sock);
errno = saved_errno;
return -1;
}
if (listen(sock, backlog) < 0) {
saved_errno = errno;
- close(sock);
- unlink(path);
error("%s: cannot listen on path %s: %s",
__func__, path, strerror(errno));
+ close(sock);
+ unlink(path);
errno = saved_errno;
return -1;
}