[openssh-commits] [openssh] 02/05: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Dec 12 10:32:50 AEDT 2017


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit fd4eeeec16537870bd40d04836c7906ec141c17d
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Fri Dec 8 02:14:33 2017 +0000

    upstream commit
    
    fix ordering in previous to ensure errno isn't clobbered
    before logging.
    
    OpenBSD-Commit-ID: e260bc1e145a9690dcb0d5aa9460c7b96a0c8ab2
---
 misc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/misc.c b/misc.c
index 827b5a75..50988cef 100644
--- a/misc.c
+++ b/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.
@@ -1515,18 +1515,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;
 	}

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list