From 5188277e2c1a4e93d97e323f8347315ca5747fc2 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 1 Sep 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-09-01 --- boot/aux.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/boot/aux.c b/boot/aux.c index 55ba8af27a79eead678b9611aec5fa6de53301ca..f69694acec067e6814254c015625c07ce5a4e464 100644 --- a/boot/aux.c +++ b/boot/aux.c @@ -136,22 +136,35 @@ srvcreate(char *name, int fd) close(f); } +static int +catchint(void *a, char *note) +{ + USED(a); + if(strcmp(note, "alarm") == 0) + return 1; + return 0; +} + int outin(char *prompt, char *def, int len) { int n; char buf[256]; + atnotify(catchint, 1); if(cpuflag) - alarm(60*1000); + alarm(15*1000); do{ print("%s[%s]: ", prompt, *def ? def : "no default"); n = read(0, buf, len); + if(cpuflag) + alarm(15*1000); }while(n==0); if(cpuflag) alarm(0); + atnotify(catchint, 0); if(n < 0) - fatal("can't read #c/cons or timeout; please reboot"); + return 1; if(n != 1){ buf[n-1] = 0; strcpy(def, buf);