summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2019-06-07 14:26:54 +1000
committerDarren Tucker <dtucker@dtucker.net>2019-06-07 14:26:54 +1000
commitd220b675205185e0b4d6b6524acc2e5c599ef0e2 (patch)
tree8659bc219f9375ccc82830c7c7b22e349bffa46a
parent1bd4f7f25f653e0cadb2e6f25d79bc3c35c6aa4d (diff)
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.
-rw-r--r--auth-pam.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/auth-pam.c b/auth-pam.c
index 8efd7b672..c0504fd05 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -197,7 +197,7 @@ pthread_create(sp_pthread_t *thread, const void *attr,
197 switch ((pid = fork())) { 197 switch ((pid = fork())) {
198 case -1: 198 case -1:
199 error("fork(): %s", strerror(errno)); 199 error("fork(): %s", strerror(errno));
200 return (-1); 200 return errno;
201 case 0: 201 case 0:
202 close(ctx->pam_psock); 202 close(ctx->pam_psock);
203 ctx->pam_psock = -1; 203 ctx->pam_psock = -1;
@@ -776,8 +776,7 @@ static void *
776sshpam_init_ctx(Authctxt *authctxt) 776sshpam_init_ctx(Authctxt *authctxt)
777{ 777{
778 struct pam_ctxt *ctxt; 778 struct pam_ctxt *ctxt;
779 int socks[2]; 779 int result, socks[2];
780 int result;
781 780
782 debug3("PAM: %s entering", __func__); 781 debug3("PAM: %s entering", __func__);
783 /* 782 /*