summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/create/pl.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-09-11 07:26:58 +0000
committerjkh <jkh@FreeBSD.org>1998-09-11 07:26:58 +0000
commitdad2df585cf830423608e2027120a5a34082d64a (patch)
tree9c49a1ce1161dfa3570080dd96d4c7194c4a8320 /usr.sbin/pkg_install/create/pl.c
parent806b06993b8d6cf5a89015512afb8bd253173403 (diff)
downloadFreeBSD-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/create/pl.c')
-rw-r--r--usr.sbin/pkg_install/create/pl.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/usr.sbin/pkg_install/create/pl.c b/usr.sbin/pkg_install/create/pl.c
index a10e383..6a01b6c 100644
--- a/usr.sbin/pkg_install/create/pl.c
+++ b/usr.sbin/pkg_install/create/pl.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: pl.c,v 1.10 1997/02/22 16:09:30 peter Exp $";
+ "$Id: pl.c,v 1.11 1997/10/08 07:46:35 charnier Exp $";
#endif
/*
@@ -85,8 +85,10 @@ trylink(const char *from, const char *to)
#define PUSHOUT() /* push out string */ \
if (where_count > sizeof(STARTSTRING)-1) { \
strcat(where_args, "|tar xpf -"); \
- if (system(where_args)) \
- cleanup(0), errx(2, "can't invoke tar pipeline"); \
+ if (system(where_args)) { \
+ cleanup(0); \
+ errx(2, "can't invoke tar pipeline"); \
+ } \
memset(where_args, 0, maxargs); \
last_chdir = NULL; \
strcpy(where_args, STARTSTRING); \
@@ -112,8 +114,10 @@ copy_plist(char *home, Package *plist)
maxargs -= 64; /* some slop for the tar cmd text,
and sh -c */
where_args = malloc(maxargs);
- if (!where_args)
- cleanup(0), errx(2, "can't get argument list space");
+ if (!where_args) {
+ cleanup(0);
+ errx(2, "can't get argument list space");
+ }
memset(where_args, 0, maxargs);
strcpy(where_args, STARTSTRING);
@@ -173,8 +177,10 @@ copy_plist(char *home, Package *plist)
p->name);
last_chdir = home;
}
- if (add_count > maxargs - where_count)
- cleanup(0), errx(2, "oops, miscounted strings!");
+ if (add_count > maxargs - where_count) {
+ cleanup(0);
+ errx(2, "oops, miscounted strings!");
+ }
where_count += add_count;
}
/*
@@ -207,8 +213,10 @@ copy_plist(char *home, Package *plist)
" -C %s %s",
mythere ? mythere : where,
p->name);
- if (add_count > maxargs - where_count)
- cleanup(0), errx(2, "oops, miscounted strings!");
+ if (add_count > maxargs - where_count) {
+ cleanup(0);
+ errx(2, "oops, miscounted strings!");
+ }
where_count += add_count;
last_chdir = (mythere ? mythere : where);
}
OpenPOWER on IntegriCloud