diff options
author | jkh <jkh@FreeBSD.org> | 1998-09-11 07:26:58 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1998-09-11 07:26:58 +0000 |
commit | dad2df585cf830423608e2027120a5a34082d64a (patch) | |
tree | 9c49a1ce1161dfa3570080dd96d4c7194c4a8320 /usr.sbin/pkg_install/lib/pen.c | |
parent | 806b06993b8d6cf5a89015512afb8bd253173403 (diff) | |
download | FreeBSD-src-dad2df585cf830423608e2027120a5a34082d64a.zip FreeBSD-src-dad2df585cf830423608e2027120a5a34082d64a.tar.gz |
correct usage of cleanup() everywhere - this became bogus when the warnx/errx
stuff was added and nobody seems to have noticed. :)
Noticed by: Josh MacDonald <jmacd@paris.CS.Berkeley.EDU>
Diffstat (limited to 'usr.sbin/pkg_install/lib/pen.c')
-rw-r--r-- | usr.sbin/pkg_install/lib/pen.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c index d914833..714dbac 100644 --- a/usr.sbin/pkg_install/lib/pen.c +++ b/usr.sbin/pkg_install/lib/pen.c @@ -1,6 +1,6 @@ #ifndef lint static const char rcsid[] = - "$Id: pen.c,v 1.28 1998/04/12 16:01:10 jkh Exp $"; + "$Id: pen.c,v 1.29 1998/07/28 01:18:02 nectar Exp $"; #endif /* @@ -129,8 +129,10 @@ make_playpen(char *pen, size_t sz) return NULL; } - if (chdir(pen) == FAIL) - cleanup(0), errx(2, "can't chdir to '%s'", pen); + if (chdir(pen) == FAIL) { + cleanup(0); + errx(2, "can't chdir to '%s'", pen); + } if (PenLocation[0]) pushPen(PenLocation); @@ -148,8 +150,10 @@ leave_playpen() /* Don't interrupt while we're cleaning up */ oldsig = signal(SIGINT, SIG_IGN); if (Previous[0]) { - if (chdir(Previous) == FAIL) - cleanup(0), errx(2, "can't chdir back to '%s'", Previous); + if (chdir(Previous) == FAIL) { + cleanup(0); + errx(2, "can't chdir back to '%s'", Previous); + } Previous[0] = '\0'; } if (PenLocation[0]) { |