[openssh-commits] [openssh] 02/02: Have pthread_create return errno on failure.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jun 7 22:52:36 AEST 2019


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

dtucker pushed a commit to branch master
in repository openssh.

commit d220b675205185e0b4d6b6524acc2e5c599ef0e2
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Jun 7 14:26:54 2019 +1000

    Have pthread_create return errno on failure.
    
    According to POSIX, pthread_create returns the failure reason in
    the non-zero function return code so make the fork wrapper do that.
    Matches previous change.
---
 auth-pam.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/auth-pam.c b/auth-pam.c
index 8efd7b67..c0504fd0 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -197,7 +197,7 @@ pthread_create(sp_pthread_t *thread, const void *attr,
 	switch ((pid = fork())) {
 	case -1:
 		error("fork(): %s", strerror(errno));
-		return (-1);
+		return errno;
 	case 0:
 		close(ctx->pam_psock);
 		ctx->pam_psock = -1;
@@ -776,8 +776,7 @@ static void *
 sshpam_init_ctx(Authctxt *authctxt)
 {
 	struct pam_ctxt *ctxt;
-	int socks[2];
-	int result;
+	int result, socks[2];
 
 	debug3("PAM: %s entering", __func__);
 	/*

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


More information about the openssh-commits mailing list