always catch SIGALRM even in non-interactive shells to make sleep work

This commit is contained in:
tg 2011-04-17 12:24:44 +00:00
parent 6c45e3e764
commit 61a8888213
3 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.445 2011/04/09 18:47:12 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.446 2011/04/17 12:24: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 2011/04/09 @(#)MIRBSD KSH R39 2011/04/17
description: description:
Check version of shell. Check version of shell.
stdin: stdin:

9
main.c
View File

@ -33,7 +33,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.189 2011/04/09 21:01:02 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/main.c,v 1.190 2011/04/17 12:24:43 tg Exp $");
extern char **environ; extern char **environ;
@ -550,13 +550,14 @@ main(int argc, const char *argv[])
} }
Flag(FERREXIT) = errexit; Flag(FERREXIT) = errexit;
if (Flag(FTALKING)) { if (Flag(FTALKING))
hist_init(s); hist_init(s);
alarm_init(); else
} else
/* set after ENV */ /* set after ENV */
Flag(FTRACKALL) = 1; Flag(FTRACKALL) = 1;
alarm_init();
if (Flag(FAS_BUILTIN)) if (Flag(FAS_BUILTIN))
return (shcomexec(l->argv)); return (shcomexec(l->argv));

4
sh.h
View File

@ -151,9 +151,9 @@
#endif #endif
#ifdef EXTERN #ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.462 2011/04/09 21:01:03 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.463 2011/04/17 12:24:44 tg Exp $");
#endif #endif
#define MKSH_VERSION "R39 2011/04/09" #define MKSH_VERSION "R39 2011/04/17"
#ifndef MKSH_INCLUDES_ONLY #ifndef MKSH_INCLUDES_ONLY