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.
This commit is contained in:
Darren Tucker 2019-06-07 14:26:54 +10:00
parent 1bd4f7f25f
commit d220b67520
1 changed files with 2 additions and 3 deletions

View File

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