jobs.c: apply patch from deraadt@o:

│remember to restore errno (ie. stop someone from making a mistake later)
│ok guenther
check.t, sh.h: bump vsn

I wonder though why errno must be restored even if nothing was
called after reading it… moid?
This commit is contained in:
tg 2009-12-31 14:05:44 +00:00
parent 01823e0e11
commit c413edb34a
3 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.349 2009/12/12 22:27:03 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.350 2009/12/31 14:05:42 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -25,7 +25,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh # http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout: expected-stdout:
@(#)MIRBSD KSH R39 2009/12/12 @(#)MIRBSD KSH R39 2009/12/31
description: description:
Check version of shell. Check version of shell.
stdin: stdin:

5
jobs.c
View File

@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.66 2009/12/12 22:27:08 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.67 2009/12/31 14:05:43 tg Exp $");
#if HAVE_KILLPG #if HAVE_KILLPG
#define mksh_killpg killpg #define mksh_killpg killpg
@ -1120,7 +1120,7 @@ j_sigchld(int sig MKSH_A_UNUSED)
for (j = job_list; j; j = j->next) for (j = job_list; j; j = j->next)
if (j->ppid == procpid && !(j->flags & JF_STARTED)) { if (j->ppid == procpid && !(j->flags & JF_STARTED)) {
held_sigchld = 1; held_sigchld = 1;
return; goto finished;
} }
getrusage(RUSAGE_CHILDREN, &ru0); getrusage(RUSAGE_CHILDREN, &ru0);
@ -1166,6 +1166,7 @@ j_sigchld(int sig MKSH_A_UNUSED)
check_job(j); /* check to see if entire job is done */ check_job(j); /* check to see if entire job is done */
} while (1); } while (1);
finished:
errno = errno_; errno = errno_;
} }

4
sh.h
View File

@ -148,9 +148,9 @@
#endif #endif
#ifdef EXTERN #ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.370 2009/12/12 22:27:09 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.371 2009/12/31 14:05:44 tg Exp $");
#endif #endif
#define MKSH_VERSION "R39 2009/12/12" #define MKSH_VERSION "R39 2009/12/31"
#ifndef MKSH_INCLUDES_ONLY #ifndef MKSH_INCLUDES_ONLY