Don't return from cleanup() - if it's removed the playpen then very

bad things will happen if we return to unsuspecting code.
Noted to my great dismay by:	Tim Vanderhoek <hoek@hwcn.org>
This commit is contained in:
Jordan K. Hubbard 1997-10-13 15:03:55 +00:00
parent e70709ad1a
commit 570f313ee4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30387
5 changed files with 14 additions and 9 deletions

View file

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.42 1997/06/29 10:41:44 jkh Exp $";
"$Id: perform.c,v 1.43 1997/10/08 07:45:48 charnier Exp $";
#endif
/*
@ -475,4 +475,5 @@ cleanup(int signo)
if (!Fake && LogDir[0])
vsystem("%s -rf %s", REMOVE_CMD, LogDir);
leave_playpen(Home);
exit(1);
}

View file

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.36 1997/07/04 04:48:02 jkh Exp $";
"$Id: perform.c,v 1.37 1997/10/08 07:46:27 charnier Exp $";
#endif
/*
@ -182,7 +182,7 @@ pkg_perform(char **pkgs)
free(Comment);
free(Desc);
free_plist(&plist);
cleanup(0);
leave_playpen(home);
return TRUE; /* Success */
}
@ -293,4 +293,5 @@ void
cleanup(int sig)
{
leave_playpen(home);
exit(1);
}

View file

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.13 1997/03/06 10:21:57 jkh Exp $";
"$Id: perform.c,v 1.14 1997/10/08 07:46:52 charnier Exp $";
#endif
/*
@ -162,6 +162,7 @@ void
cleanup(int sig)
{
/* Nothing to do */
exit(1);
}
static void

View file

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: perform.c,v 1.21 1997/02/22 16:09:42 peter Exp $";
"$Id: perform.c,v 1.22 1997/10/08 07:47:29 charnier Exp $";
#endif
/*
@ -202,4 +202,5 @@ void
cleanup(int sig)
{
leave_playpen(Home);
exit(1);
}

View file

@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
"$Id: msg.c,v 1.8 1997/02/22 16:09:50 peter Exp $";
"$Id: msg.c,v 1.9 1997/10/08 07:48:09 charnier Exp $";
#endif
/*
@ -33,7 +33,6 @@ upchuck(const char *err)
{
warn("fatal error during execution: %s", err);
cleanup(0);
exit(1);
}
/*
@ -53,8 +52,10 @@ y_or_n(Boolean def, const char *msg, ...)
* collected on stdin
*/
tty = fopen("/dev/tty", "r");
if (!tty)
cleanup(0), errx(2, "can't open /dev/tty!");
if (!tty) {
warnx("can't open /dev/tty!");
cleanup(0);
}
while (ch != 'Y' && ch != 'N') {
vfprintf(stderr, msg, args);
if (def)