summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorPeter Tribble <peter.tribble@gmail.com>2017-05-27 11:10:43 +0100
committerDan McDonald <danmcd@joyent.com>2017-06-12 10:30:30 -0400
commit2e10def11ef1a50c25efa2444482670e6b0654ff (patch)
tree121572b7b6f793a0cf09654bacd31d43558e6672 /usr/src
parent311c88c1ed31408e0998a9aabb8e7d0d12ef83ad (diff)
downloadillumos-joyent-2e10def11ef1a50c25efa2444482670e6b0654ff.tar.gz
8302 svr4pkg unused variables
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/svr4pkg/Makefile.svr4pkg5
-rw-r--r--usr/src/cmd/svr4pkg/libinst/Makefile3
-rw-r--r--usr/src/cmd/svr4pkg/libinst/ocfile.c19
-rw-r--r--usr/src/cmd/svr4pkg/libinst/stub.c46
-rw-r--r--usr/src/cmd/svr4pkg/pkgadd/main.c362
-rw-r--r--usr/src/cmd/svr4pkg/pkgadm/lock.c2
-rw-r--r--usr/src/cmd/svr4pkg/pkgadm/main.c2
-rw-r--r--usr/src/cmd/svr4pkg/pkgcond/main.c223
-rw-r--r--usr/src/cmd/svr4pkg/pkginfo/pkginfo.c41
-rw-r--r--usr/src/cmd/svr4pkg/pkginstall/dockspace.c10
-rw-r--r--usr/src/cmd/svr4pkg/pkgremove/check.c5
-rw-r--r--usr/src/cmd/svr4pkg/pkgtrans/main.c4
12 files changed, 342 insertions, 380 deletions
diff --git a/usr/src/cmd/svr4pkg/Makefile.svr4pkg b/usr/src/cmd/svr4pkg/Makefile.svr4pkg
index 89c4854e39..fc343556fc 100644
--- a/usr/src/cmd/svr4pkg/Makefile.svr4pkg
+++ b/usr/src/cmd/svr4pkg/Makefile.svr4pkg
@@ -20,6 +20,7 @@
#
#
+# Copyright (c) 2017 Peter Tribble.
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -33,12 +34,8 @@ CPPFLAGS += -I$(SRC)/cmd/svr4pkg/hdrs \
-D_FILE_OFFSET_BITS=64
-CERRWARN += -_gcc=-Wno-unused-variable
-CERRWARN += -_gcc=-Wno-implicit-function-declaration
-CERRWARN += -_gcc=-Wno-extra
CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-uninitialized
-CERRWARN += -_gcc=-Wno-char-subscripts
CERRWARN += -_gcc=-Wno-address
LIBINST = $(SRC)/cmd/svr4pkg/libinst/libinst.a
diff --git a/usr/src/cmd/svr4pkg/libinst/Makefile b/usr/src/cmd/svr4pkg/libinst/Makefile
index 89823b854d..3da766690a 100644
--- a/usr/src/cmd/svr4pkg/libinst/Makefile
+++ b/usr/src/cmd/svr4pkg/libinst/Makefile
@@ -20,6 +20,7 @@
#
#
+# Copyright (c) 2017 Peter Tribble.
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -32,7 +33,7 @@ OBJS= copyf.o dockdeps.o echo.o eptstat.o \
ocfile.o pathdup.o pkgdbmerg.o procmap.o \
pkgobjmap.o ptext.o putparam.o \
qreason.o qstrdup.o setadmin.o setlist.o \
- srcpath.o scriptvfy.o stub.o doulimit.o \
+ srcpath.o scriptvfy.o doulimit.o \
dryrun.o listmgr.o is_local_host.o cvtpath.o \
depchk.o pkgops.o sml.o log.o \
setup_temporary_directory.o open_package_datastream.o \
diff --git a/usr/src/cmd/svr4pkg/libinst/ocfile.c b/usr/src/cmd/svr4pkg/libinst/ocfile.c
index 0cbc95516c..938151d39c 100644
--- a/usr/src/cmd/svr4pkg/libinst/ocfile.c
+++ b/usr/src/cmd/svr4pkg/libinst/ocfile.c
@@ -20,6 +20,10 @@
*/
/*
+ * Copyright (c) 2017 Peter Tribble.
+ */
+
+/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -206,7 +210,6 @@ ocfile(PKGserver *server, VFP_T **r_tmpvfp, fsblkcnt_t map_blks)
VFP_T *tmpvfp = (VFP_T *)NULL;
char contents[PATH_MAX];
char logfile[PATH_MAX];
- int n;
off_t cdiff_alloc;
PKGserver newserver;
@@ -371,7 +374,6 @@ ocfile(PKGserver *server, VFP_T **r_tmpvfp, fsblkcnt_t map_blks)
int
socfile(PKGserver *server, boolean_t quiet)
{
- char contents[PATH_MAX];
boolean_t readonly = B_FALSE;
PKGserver newserver;
@@ -513,8 +515,6 @@ swapcfile(PKGserver server, VFP_T **a_cfTmpVfp, char *pkginst, int dbchg)
/* commit temporary contents file bytes to storage */
if (pkgservercommitfile(*a_cfTmpVfp, server) != 0) {
- int lerrno = errno;
-
logerr(gettext(ERR_COMMIT));
vfpClose(a_cfTmpVfp);
pkgcloseserver(server);
@@ -548,14 +548,15 @@ relslock(void)
* or not the function displays the error message upon failure.
*/
int
-pkgWlock(int verbose) {
+pkgWlock(int verbose)
+{
int retry_cnt, retval;
char lockpath[PATH_MAX];
active_lock = 0;
(void) snprintf(lockpath, sizeof (lockpath),
- "%s/%s", pkgadm_dir, LOCKFILE);
+ "%s/%s", pkgadm_dir, LOCKFILE);
retry_cnt = LOCKRETRY;
@@ -610,8 +611,7 @@ pkgWlock(int verbose) {
(void) signal(SIGALRM, SIG_IGN);
- if (retval == 0)
- {
+ if (retval == 0) {
if (retry_cnt == -1) {
logerr(gettext(ERR_TMOUT));
}
@@ -627,7 +627,8 @@ pkgWlock(int verbose) {
* failure.
*/
static int
-pkgWunlock(void) {
+pkgWunlock(void)
+{
if (active_lock) {
active_lock = 0;
if (close(lock_fd))
diff --git a/usr/src/cmd/svr4pkg/libinst/stub.c b/usr/src/cmd/svr4pkg/libinst/stub.c
deleted file mode 100644
index 1deca146eb..0000000000
--- a/usr/src/cmd/svr4pkg/libinst/stub.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
-
-
-#ifdef PRESVR4
-int
-rename(char *x, char *y)
-{
- return (link(x, y) || unlink(x));
-}
-#else
-static int dummy; /* used to make compillor warning go away */
-#ifdef lint
-_______a()
-{
- return (dummy++);
-}
-#endif /* lint */
-#endif
diff --git a/usr/src/cmd/svr4pkg/pkgadd/main.c b/usr/src/cmd/svr4pkg/pkgadd/main.c
index 1e201f4b5a..c2f0125d55 100644
--- a/usr/src/cmd/svr4pkg/pkgadd/main.c
+++ b/usr/src/cmd/svr4pkg/pkgadd/main.c
@@ -349,7 +349,7 @@ main(int argc, char **argv)
*/
while ((c = getopt(argc, argv,
- "?Aa:b:B:Cc:D:d:GhIMnO:R:r:Ss:tV:vY:zZ")) != EOF) {
+ "?Aa:b:B:Cc:D:d:GhIMnO:R:r:Ss:tV:vY:zZ")) != EOF) {
switch (c) {
/*
@@ -529,7 +529,7 @@ main(int argc, char **argv)
case 'O':
for (p = strtok(optarg, ","); p != (char *)NULL;
- p = strtok(NULL, ",")) {
+ p = strtok(NULL, ",")) {
if (strcmp(p, "debug") == 0) {
/* set debug flag/enable debug output */
@@ -545,7 +545,7 @@ main(int argc, char **argv)
}
if (strcmp(p,
- "enable-hollow-package-support") == 0) {
+ "enable-hollow-package-support") == 0) {
set_depend_pkginfo_DB(B_TRUE);
continue;
}
@@ -768,7 +768,7 @@ main(int argc, char **argv)
echoDebug(DBG_ENTRY_IN_GZ, prog_full_name);
} else {
echoDebug(DBG_ENTRY_IN_LZ, prog_full_name, getzoneid(),
- z_get_zonename());
+ z_get_zonename());
}
/*
@@ -905,8 +905,8 @@ main(int argc, char **argv)
set_PKGpaths(get_inst_root());
echoDebug(DBG_PKGADD_PKGPATHS,
- get_PKGLOC() ? get_PKGLOC() : "",
- get_PKGADM() ? get_PKGADM() : "");
+ get_PKGLOC() ? get_PKGLOC() : "",
+ get_PKGADM() ? get_PKGADM() : "");
/*
* This function is in the libinst library; it reads the specified
@@ -927,7 +927,7 @@ main(int argc, char **argv)
if (is_depend_pkginfo_DB()) {
echoDebug(DBG_PKGADD_HOLLOW_ENABLED);
} else if ((z_running_in_global_zone() == B_TRUE) &&
- (z_non_global_zones_exist() == B_TRUE)) {
+ (z_non_global_zones_exist() == B_TRUE)) {
echoDebug(DBG_PKGADD_ENABLING_HOLLOW);
set_depend_pkginfo_DB(B_TRUE);
}
@@ -956,7 +956,7 @@ main(int argc, char **argv)
if (respfile) {
echoDebug(DBG_PKGADD_RESPFILE,
- respfile, respdir ? respdir : "");
+ respfile, respdir ? respdir : "");
if (respfile[0] != '/') {
progerr(ERR_RSP_FILE_NOTFULLPATH, respfile);
@@ -1045,8 +1045,8 @@ main(int argc, char **argv)
echoDebug(DBG_INSTALLING_TO_SPOOL, spoolDir);
b = open_package_datastream(argc, argv, spoolDir, device,
- &repeat, &ids_name, tmpdir,
- &pkgdev, optind);
+ &repeat, &ids_name, tmpdir,
+ &pkgdev, optind);
quitSetIdsName(ids_name);
@@ -1090,8 +1090,8 @@ main(int argc, char **argv)
*/
b = open_package_datastream(argc, argv, spoolDir, device,
- &repeat, &ids_name, tmpdir,
- &pkgdev, optind);
+ &repeat, &ids_name, tmpdir,
+ &pkgdev, optind);
quitSetIdsName(ids_name);
@@ -1105,11 +1105,9 @@ main(int argc, char **argv)
*/
b = get_package_list(&pkglist, argv, catg_arg, category,
- ids_name, &repeat);
+ ids_name, &repeat);
if (b == B_FALSE) {
- char path[PATH_MAX];
-
echoDebug(DBG_CANNOT_GET_PKGLIST);
progerr(ERR_NOPKGS, pkgdev.dirname);
@@ -1141,7 +1139,7 @@ main(int argc, char **argv)
*/
if ((askflag != 0) && (respdir == (char *)NULL) &&
- (npkgs > 1)) {
+ (npkgs > 1)) {
progerr(ERR_TOO_MANY_PKGS);
quit(1);
/* NOTREACHED */
@@ -1152,7 +1150,7 @@ main(int argc, char **argv)
*/
b = add_packages(pkglist, ids_name, repeat,
- altBinDir, device, noZones);
+ altBinDir, device, noZones);
/*
* close open input data stream (source package) if left open.
@@ -1160,7 +1158,7 @@ main(int argc, char **argv)
if (ids_name) {
echoDebug(DBG_CLOSING_STREAM, ids_name,
- PSTR(pkgdev.dirname));
+ PSTR(pkgdev.dirname));
(void) ds_close(1);
rrmdir(pkgdev.dirname);
ids_name = NULL;
@@ -1229,8 +1227,8 @@ main(int argc, char **argv)
static int
pkgZoneCheckInstall(char *a_zoneName, zone_state_t a_zoneState,
- char *a_idsName, char *a_altBinDir, char *a_adminFile,
- char *a_stdoutPath, boolean_t a_tmpzn)
+ char *a_idsName, char *a_altBinDir, char *a_adminFile,
+ char *a_stdoutPath, boolean_t a_tmpzn)
{
char *arg[MAXARGS];
char *p;
@@ -1251,14 +1249,14 @@ pkgZoneCheckInstall(char *a_zoneName, zone_state_t a_zoneState,
echoDebug(DBG_PKGZONECHECKINSTALL_ENTRY);
echoDebug(DBG_PKGZONECHECKINSTALL_ARGS, a_zoneName, PSTR(pkginst),
- PSTR(pkgdev.dirname), PSTR(pkgdev.mount), PSTR(pkgdev.bdevice),
- a_zoneState == ZONE_STATE_MOUNTED ? "/a" : "/",
- PSTR(a_idsName), PSTR(a_adminFile), PSTR(a_stdoutPath));
+ PSTR(pkgdev.dirname), PSTR(pkgdev.mount), PSTR(pkgdev.bdevice),
+ a_zoneState == ZONE_STATE_MOUNTED ? "/a" : "/",
+ PSTR(a_idsName), PSTR(a_adminFile), PSTR(a_stdoutPath));
/* generate full path to 'phatinstall' to run in zone */
(void) snprintf(path, sizeof (path), "%s/pkginstall",
- "/usr/sadm/install/bin");
+ "/usr/sadm/install/bin");
/* start at first file descriptor */
@@ -1371,11 +1369,11 @@ pkgZoneCheckInstall(char *a_zoneName, zone_state_t a_zoneState,
fd = openLocal(a_adminFile, O_RDONLY, tmpdir);
if (fd < 0) {
progerr(ERR_CANNOT_COPY_LOCAL, a_adminFile,
- errno, strerror(errno));
+ errno, strerror(errno));
return (1);
}
(void) snprintf(adminfd_path, sizeof (adminfd_path),
- "/proc/self/fd/%d", fd);
+ "/proc/self/fd/%d", fd);
fds[maxfds++] = fd;
arg[nargs++] = "-a";
arg[nargs++] = adminfd_path;
@@ -1411,7 +1409,7 @@ pkgZoneCheckInstall(char *a_zoneName, zone_state_t a_zoneState,
if ((p != NULL) && (*p != '\0')) {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-name=%s", p);
+ "parent-zone-name=%s", p);
arg[nargs++] = "-O";
arg[nargs++] = strdup(zn);
}
@@ -1422,14 +1420,14 @@ pkgZoneCheckInstall(char *a_zoneName, zone_state_t a_zoneState,
if (z_running_in_global_zone() == B_TRUE) {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-type=%s",
- TAG_VALUE_GLOBAL_ZONE);
+ "parent-zone-type=%s",
+ TAG_VALUE_GLOBAL_ZONE);
arg[nargs++] = strdup(zn);
} else {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-type=%s",
- TAG_VALUE_NONGLOBAL_ZONE);
+ "parent-zone-type=%s",
+ TAG_VALUE_NONGLOBAL_ZONE);
arg[nargs++] = strdup(zn);
}
@@ -1444,11 +1442,11 @@ pkgZoneCheckInstall(char *a_zoneName, zone_state_t a_zoneState,
fd = openLocal(a_idsName, O_RDONLY, tmpdir);
if (fd < 0) {
progerr(ERR_STREAM_UNAVAILABLE, a_idsName,
- pkginst, strerror(errno));
+ pkginst, strerror(errno));
quit(1);
}
(void) snprintf(pkgstreamfd_path, sizeof (pkgstreamfd_path),
- "/proc/self/fd/%d", fd);
+ "/proc/self/fd/%d", fd);
fds[maxfds++] = fd;
arg[nargs++] = pkgstreamfd_path;
} else {
@@ -1484,7 +1482,7 @@ pkgZoneCheckInstall(char *a_zoneName, zone_state_t a_zoneState,
n = z_zone_exec(a_zoneName, path, arg, a_stdoutPath, (char *)NULL, fds);
echoDebug(DBG_ZONE_EXEC_EXIT, a_zoneName, arg[0], n,
- PSTR(a_stdoutPath));
+ PSTR(a_stdoutPath));
/*
* close any files that were opened for use by the
@@ -1560,9 +1558,9 @@ pkgZoneInstall(char *a_zoneName, zone_state_t a_zoneState, char *a_idsName,
echoDebug(DBG_PKGZONEINSTALL_ENTRY);
echoDebug(DBG_PKGZONEINSTALL_ARGS, a_zoneName, PSTR(pkginst),
- PSTR(pkgdev.dirname), PSTR(pkgdev.mount), PSTR(pkgdev.bdevice),
- a_zoneState == ZONE_STATE_MOUNTED ? "/a" : "", PSTR(a_idsName),
- a_adminFile);
+ PSTR(pkgdev.dirname), PSTR(pkgdev.mount), PSTR(pkgdev.bdevice),
+ a_zoneState == ZONE_STATE_MOUNTED ? "/a" : "", PSTR(a_idsName),
+ a_adminFile);
/* generate path to pkginstall */
@@ -1684,11 +1682,11 @@ pkgZoneInstall(char *a_zoneName, zone_state_t a_zoneState, char *a_idsName,
fd = openLocal(a_adminFile, O_RDONLY, tmpdir);
if (fd < 0) {
progerr(ERR_CANNOT_COPY_LOCAL, a_adminFile,
- errno, strerror(errno));
+ errno, strerror(errno));
return (1);
}
(void) snprintf(adminfd_path, sizeof (adminfd_path),
- "/proc/self/fd/%d", fd);
+ "/proc/self/fd/%d", fd);
fds[maxfds++] = fd;
arg[nargs++] = "-a";
arg[nargs++] = adminfd_path;
@@ -1725,12 +1723,12 @@ pkgZoneInstall(char *a_zoneName, zone_state_t a_zoneState, char *a_idsName,
fd = openLocal(respfile, O_RDONLY, tmpdir);
if (fd < 0) {
progerr(ERR_CANNOT_COPY_LOCAL, a_adminFile,
- errno, strerror(errno));
+ errno, strerror(errno));
return (1);
}
(void) snprintf(respfilefd_path,
- sizeof (respfilefd_path),
- "/proc/self/fd/%d", fd);
+ sizeof (respfilefd_path),
+ "/proc/self/fd/%d", fd);
fds[maxfds++] = fd;
arg[nargs++] = "-r";
arg[nargs++] = respfilefd_path;
@@ -1749,7 +1747,7 @@ pkgZoneInstall(char *a_zoneName, zone_state_t a_zoneState, char *a_idsName,
if ((p != NULL) && (*p != '\0')) {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-name=%s", p);
+ "parent-zone-name=%s", p);
arg[nargs++] = "-O";
arg[nargs++] = strdup(zn);
}
@@ -1760,14 +1758,14 @@ pkgZoneInstall(char *a_zoneName, zone_state_t a_zoneState, char *a_idsName,
if (z_running_in_global_zone() == B_TRUE) {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-type=%s",
- TAG_VALUE_GLOBAL_ZONE);
+ "parent-zone-type=%s",
+ TAG_VALUE_GLOBAL_ZONE);
arg[nargs++] = strdup(zn);
} else {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-type=%s",
- TAG_VALUE_NONGLOBAL_ZONE);
+ "parent-zone-type=%s",
+ TAG_VALUE_NONGLOBAL_ZONE);
arg[nargs++] = strdup(zn);
}
@@ -1782,11 +1780,11 @@ pkgZoneInstall(char *a_zoneName, zone_state_t a_zoneState, char *a_idsName,
fd = openLocal(a_idsName, O_RDONLY, tmpdir);
if (fd < 0) {
progerr(ERR_STREAM_UNAVAILABLE, a_idsName,
- pkginst, strerror(errno));
+ pkginst, strerror(errno));
quit(1);
}
(void) snprintf(pkgstreamfd_path, sizeof (pkgstreamfd_path),
- "/proc/self/fd/%d", fd);
+ "/proc/self/fd/%d", fd);
fds[maxfds++] = fd;
arg[nargs++] = pkgstreamfd_path;
} else {
@@ -1882,13 +1880,13 @@ pkgInstall(char *a_altRoot, char *a_idsName, char *a_pkgDir, char *a_altBinDir)
echoDebug(DBG_PKGINSTALL_ENTRY);
echoDebug(DBG_PKGINSTALL_ARGS, PSTR(pkginst), PSTR(pkgdev.dirname),
- PSTR(pkgdev.mount), PSTR(pkgdev.bdevice), PSTR(a_altRoot),
- PSTR(a_idsName), PSTR(a_pkgDir));
+ PSTR(pkgdev.mount), PSTR(pkgdev.bdevice), PSTR(a_altRoot),
+ PSTR(a_idsName), PSTR(a_pkgDir));
/* generate full path to 'pkginstall' to run in zone */
(void) snprintf(path, sizeof (path), "%s/pkginstall",
- a_altBinDir == (char *)NULL ? PKGBIN : a_altBinDir);
+ a_altBinDir == (char *)NULL ? PKGBIN : a_altBinDir);
/*
* generate argument list for call to pkginstall
*/
@@ -2117,7 +2115,7 @@ pkgInstall(char *a_altRoot, char *a_idsName, char *a_pkgDir, char *a_altBinDir)
if ((p != NULL) && (*p != '\0')) {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-name=%s", p);
+ "parent-zone-name=%s", p);
arg[nargs++] = "-O";
arg[nargs++] = strdup(zn);
}
@@ -2128,14 +2126,14 @@ pkgInstall(char *a_altRoot, char *a_idsName, char *a_pkgDir, char *a_altBinDir)
if (z_running_in_global_zone() == B_TRUE) {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-type=%s",
- TAG_VALUE_GLOBAL_ZONE);
+ "parent-zone-type=%s",
+ TAG_VALUE_GLOBAL_ZONE);
arg[nargs++] = strdup(zn);
} else {
char zn[MAXPATHLEN];
(void) snprintf(zn, sizeof (zn),
- "parent-zone-type=%s",
- TAG_VALUE_NONGLOBAL_ZONE);
+ "parent-zone-type=%s",
+ TAG_VALUE_NONGLOBAL_ZONE);
arg[nargs++] = strdup(zn);
}
@@ -2211,51 +2209,51 @@ ckreturn(int retcode)
needconsult = 0;
switch (retcode) {
- case 0: /* successful */
- case 10:
- case 20:
+ case 0: /* successful */
+ case 10:
+ case 20:
break; /* empty case */
- case 1: /* package operation failed (fatal error) */
- case 11:
- case 21:
+ case 1: /* package operation failed (fatal error) */
+ case 11:
+ case 21:
failflag++;
interrupted++;
needconsult++;
break;
- case 2: /* non-fatal error (warning) */
- case 12:
- case 22:
+ case 2: /* non-fatal error (warning) */
+ case 12:
+ case 22:
warnflag++;
interrupted++;
needconsult++;
break;
- case 3: /* user selected quit; operation interrupted */
- case 13:
- case 23:
+ case 3: /* user selected quit; operation interrupted */
+ case 13:
+ case 23:
intrflag++;
interrupted++;
needconsult++;
break;
- case 4: /* admin settings prevented operation */
- case 14:
- case 24:
+ case 4: /* admin settings prevented operation */
+ case 14:
+ case 24:
admnflag++;
interrupted++;
break;
- case 5: /* administration: interaction req (no -n) */
- case 15:
- case 25:
+ case 5: /* administration: interaction req (no -n) */
+ case 15:
+ case 25:
nullflag++;
interrupted++;
needconsult++;
break;
- default:
+ default:
failflag++;
interrupted++;
needconsult++;
@@ -2278,10 +2276,10 @@ usage(void)
(void) fprintf(stderr, ERR_USAGE_PKGASK, prog);
} else if (z_running_in_global_zone() == B_FALSE) {
(void) fprintf(stderr, ERR_USAGE_PKGADD_NONGLOBALZONE,
- prog, prog);
+ prog, prog);
} else {
(void) fprintf(stderr, ERR_USAGE_PKGADD_GLOBALZONE,
- prog, prog);
+ prog, prog);
}
}
@@ -2313,7 +2311,7 @@ usage(void)
static boolean_t
check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
- CAF_T a_flags)
+ CAF_T a_flags)
{
FILE *pkginfoFP;
FILE *pkgmapFP;
@@ -2356,7 +2354,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
/* path to package to be installed top level (main) directory */
len = snprintf(pkgpath, sizeof (pkgpath), "%s/%s", a_packageDir,
- a_pkgInst);
+ a_pkgInst);
if (len > sizeof (pkgpath)) {
progerr(ERR_CREATE_PATH_2, a_packageDir, a_pkgInst);
return (B_FALSE);
@@ -2372,7 +2370,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
/* path to pkginfo file within the package to be installed */
len = snprintf(pkginfoPath, sizeof (pkginfoPath), "%s/pkginfo",
- pkgpath);
+ pkgpath);
if (len > sizeof (pkginfoPath)) {
progerr(ERR_CREATE_PATH_2, pkgpath, "pkginfo");
return (B_FALSE);
@@ -2381,7 +2379,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
/* path to highest instance of package currently installed */
pkgLocateHighestInst(instPkgPath, sizeof (instPkgPath),
- instPkg, sizeof (instPkg), a_rootPath, a_pkgInst);
+ instPkg, sizeof (instPkg), a_rootPath, a_pkgInst);
/*
* gather information from this package's pkginfo file
@@ -2391,24 +2389,24 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
if (pkginfoFP == (FILE *)NULL) {
progerr(ERR_NO_PKG_INFOFILE, a_pkgInst, pkginfoPath,
- strerror(errno));
+ strerror(errno));
return (B_FALSE);
}
/* determine "HOLLOW" setting for this package */
is_hollow = pkginfoParamTruth(pkginfoFP, PKG_HOLLOW_VARIABLE,
- "true", B_FALSE);
+ "true", B_FALSE);
/* determine "ALLZONES" setting for this package */
all_zones = pkginfoParamTruth(pkginfoFP, PKG_ALLZONES_VARIABLE,
- "true", B_FALSE);
+ "true", B_FALSE);
/* determine "THISZONE" setting for this package */
this_zone = pkginfoParamTruth(pkginfoFP, PKG_THISZONE_VARIABLE,
- "true", B_FALSE);
+ "true", B_FALSE);
/* close pkginfo file */
@@ -2469,10 +2467,10 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
*/
if ((!this_zone) && (instPkgPath[0] != '\0') &&
- (isfile(instPkgPath, REQUEST_FILE) == 0)) {
+ (isfile(instPkgPath, REQUEST_FILE) == 0)) {
if (a_flags & CAF_IN_GLOBAL_ZONE) {
echoDebug(DBG_CHECKAPP_THISZONE_INSTREQ,
- a_pkgInst, instPkg);
+ a_pkgInst, instPkg);
}
this_zone = B_TRUE;
}
@@ -2487,7 +2485,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
/* determine if this package is currently installed */
pkg_installed = pkginfoIsPkgInstalled((struct pkginfo **)NULL,
- a_pkgInst);
+ a_pkgInst);
/*
* verify package applicability based on information gathered,
@@ -2527,7 +2525,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
if (all_zones && this_zone) {
progerr(ERR_ALLZONES_AND_THISZONE, a_pkgInst,
- PKG_ALLZONES_VARIABLE, PKG_THISZONE_VARIABLE);
+ PKG_ALLZONES_VARIABLE, PKG_THISZONE_VARIABLE);
return (B_FALSE);
}
@@ -2535,7 +2533,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
if ((!all_zones) && is_hollow) {
progerr(ERR_NOW_ALLZONES_AND_HOLLOW, a_pkgInst,
- PKG_ALLZONES_VARIABLE, PKG_HOLLOW_VARIABLE);
+ PKG_ALLZONES_VARIABLE, PKG_HOLLOW_VARIABLE);
return (B_FALSE);
}
@@ -2558,7 +2556,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
if (in_gz_only && (!pkg_installed)) {
/* MAKE A WARNING */
echo(ERR_IN_GZ_AND_NOT_INSTALLED, a_pkgInst,
- pkgGetGzOnlyPath());
+ pkgGetGzOnlyPath());
}
/* pkg ALLZONES=true & pkg "in gz only" & pkg "is installed" */
@@ -2593,7 +2591,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
if (this_zone && (a_flags & CAF_SCOPE_NONGLOBAL)) {
progerr(ERR_THISZONE_AND_Z_USED, PKG_THISZONE_VARIABLE,
- a_pkgInst);
+ a_pkgInst);
return (B_FALSE);
}
@@ -2643,7 +2641,7 @@ check_applicability(char *a_packageDir, char *a_pkgInst, char *a_rootPath,
static void
create_zone_adminfile(char **r_zoneAdminFile, char *a_zoneTempDir,
- char *a_admnfile)
+ char *a_admnfile)
{
boolean_t b;
@@ -2669,7 +2667,7 @@ create_zone_adminfile(char **r_zoneAdminFile, char *a_zoneTempDir,
b = z_create_zone_admin_file(*r_zoneAdminFile, a_admnfile);
if (b == B_FALSE) {
progerr(ERR_CREATE_TMPADMIN, *r_zoneAdminFile,
- strerror(errno));
+ strerror(errno));
quit(1);
/* NOTREACHED */
}
@@ -2857,10 +2855,10 @@ unpack_and_check_packages(char **a_pkgList, char *a_idsName, char *a_packageDir)
if (a_idsName != (char *)NULL) {
/* create stream out of package if not already one */
if (unpack_package_from_stream(a_idsName, pkginst,
- a_packageDir) == B_FALSE) {
+ a_packageDir) == B_FALSE) {
progerr(ERR_CANNOT_UNPACK_PKGSTRM,
- PSTR(pkginst), PSTR(a_idsName),
- PSTR(a_packageDir));
+ PSTR(pkginst), PSTR(a_idsName),
+ PSTR(a_packageDir));
npkgs = savenpkgs;
return (B_FALSE);
@@ -2871,7 +2869,7 @@ unpack_and_check_packages(char **a_pkgList, char *a_idsName, char *a_packageDir)
/* check package applicability */
if (check_applicability(a_packageDir,
- pkginst, get_inst_root(), flags) == B_FALSE) {
+ pkginst, get_inst_root(), flags) == B_FALSE) {
progerr(ERR_PKG_NOT_INSTALLABLE, pkginst);
npkgs = savenpkgs;
return (B_FALSE);
@@ -2892,7 +2890,7 @@ unpack_and_check_packages(char **a_pkgList, char *a_idsName, char *a_packageDir)
static boolean_t
get_package_list(char ***r_pkgList, char **a_argv, char *a_categories,
- char **a_categoryList, char *a_idsName, int *r_repeat)
+ char **a_categoryList, char *a_idsName, int *r_repeat)
{
int n;
@@ -2904,19 +2902,19 @@ get_package_list(char ***r_pkgList, char **a_argv, char *a_categories,
echoDebug(DBG_GETPKGLIST_ENTRY);
echoDebug(DBG_GETPKGLIST_ARGS, PSTR(a_idsName), PSTR(pkgdev.dirname),
- *r_repeat);
+ *r_repeat);
/*
* get the list of the packages to add
*/
n = pkgGetPackageList(r_pkgList, a_argv, optind, a_categories,
- a_categoryList, &pkgdev);
+ a_categoryList, &pkgdev);
switch (n) {
case -1: /* no packages found */
echoDebug(DBG_PKGLIST_NONFOUND, PSTR(a_idsName),
- pkgdev.dirname);
+ pkgdev.dirname);
return (B_FALSE);
case 0: /* packages found */
@@ -2924,7 +2922,7 @@ get_package_list(char ***r_pkgList, char **a_argv, char *a_categories,
default: /* "quit" error */
echoDebug(DBG_PKGLIST_ERROR, PSTR(a_idsName),
- pkgdev.dirname, n);
+ pkgdev.dirname, n);
quit(n);
/* NOTREACHED */
}
@@ -2972,8 +2970,8 @@ get_package_list(char ***r_pkgList, char **a_argv, char *a_categories,
static void
install_in_one_zone(char *a_zoneName, char *a_idsName,
- char *a_zoneAdminFile, char *a_zoneTempDir,
- char *a_altBinDir, zone_state_t a_zoneState, boolean_t a_tmpzn)
+ char *a_zoneAdminFile, char *a_zoneTempDir,
+ char *a_altBinDir, zone_state_t a_zoneState, boolean_t a_tmpzn)
{
char zoneStreamName[PATH_MAX] = {'\0'};
int n;
@@ -2987,8 +2985,8 @@ install_in_one_zone(char *a_zoneName, char *a_idsName,
echoDebug(DBG_INSTINONEZONE_ENTRY);
echoDebug(DBG_INSTINONEZONE_ARGS, a_zoneName, PSTR(a_idsName),
- PSTR(a_zoneAdminFile), PSTR(a_zoneTempDir),
- PSTR(a_altBinDir));
+ PSTR(a_zoneAdminFile), PSTR(a_zoneTempDir),
+ PSTR(a_altBinDir));
/* echo operation to perform to stdout */
@@ -2999,11 +2997,11 @@ install_in_one_zone(char *a_zoneName, char *a_idsName,
if (a_idsName == (char *)NULL) {
/* locate temp stream created earlier */
(void) snprintf(zoneStreamName, sizeof (zoneStreamName),
- "%s/%s.dstream", a_zoneTempDir, pkginst);
+ "%s/%s.dstream", a_zoneTempDir, pkginst);
} else {
/* use stream passed in on command line */
(void) snprintf(zoneStreamName, sizeof (zoneStreamName),
- "%s", a_idsName);
+ "%s", a_idsName);
}
echoDebug(DBG_INSTALL_IN_ZONE, pkginst, a_zoneName, zoneStreamName);
@@ -3018,8 +3016,8 @@ install_in_one_zone(char *a_zoneName, char *a_idsName,
/* exit debugging info */
echoDebug(DBG_INSTALL_FLAG_VALUES, "after install", admnflag, doreboot,
- failflag, interrupted, intrflag, ireboot, needconsult,
- nullflag, warnflag);
+ failflag, interrupted, intrflag, ireboot, needconsult,
+ nullflag, warnflag);
}
/*
@@ -3046,7 +3044,7 @@ install_in_one_zone(char *a_zoneName, char *a_idsName,
static int
install_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
- char *a_zoneAdminFile, char *a_zoneTempDir)
+ char *a_zoneAdminFile, char *a_zoneTempDir)
{
char *zoneName;
int zoneIndex;
@@ -3061,13 +3059,13 @@ install_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
echoDebug(DBG_INSTALLINZONES_ENTRY);
echoDebug(DBG_INSTALLINZONES_ARGS, PSTR(a_idsName),
- PSTR(a_zoneAdminFile), PSTR(a_zoneTempDir));
+ PSTR(a_zoneAdminFile), PSTR(a_zoneTempDir));
/* process each zone in the list */
for (zoneIndex = 0;
- (zoneName = z_zlist_get_zonename(a_zlst, zoneIndex)) != NULL;
- zoneIndex++) {
+ (zoneName = z_zlist_get_zonename(a_zlst, zoneIndex)) != NULL;
+ zoneIndex++) {
/* skip the zone if it is NOT running */
@@ -3113,7 +3111,7 @@ install_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
static int
boot_and_install_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
- char *a_zoneAdminFile, char *a_zoneTempDir)
+ char *a_zoneAdminFile, char *a_zoneTempDir)
{
boolean_t b;
char *zoneName;
@@ -3129,13 +3127,13 @@ boot_and_install_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
echoDebug(DBG_BOOTINSTALLINZONES_ENTRY);
echoDebug(DBG_BOOTINSTALLINZONES_ARGS, PSTR(a_idsName),
- PSTR(a_zoneAdminFile), PSTR(a_zoneTempDir));
+ PSTR(a_zoneAdminFile), PSTR(a_zoneTempDir));
/* process each zone in the list */
for (zoneIndex = 0;
- (zoneName = z_zlist_get_zonename(a_zlst, zoneIndex)) != NULL;
- zoneIndex++) {
+ (zoneName = z_zlist_get_zonename(a_zlst, zoneIndex)) != NULL;
+ zoneIndex++) {
/* skip the zone if it IS running */
@@ -3159,7 +3157,7 @@ boot_and_install_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
echoDebug(DBG_BOOTING_ZONE, zoneName);
b = z_zlist_change_zone_state(a_zlst, zoneIndex,
- ZONE_STATE_MOUNTED);
+ ZONE_STATE_MOUNTED);
if (b == B_FALSE) {
progerr(ERR_CANNOT_BOOT_ZONE, zoneName);
/* set fatal error return condition */
@@ -3219,9 +3217,9 @@ boot_and_install_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
static void
pkginstall_check_in_one_zone(char *a_zoneName,
- char *a_idsName, char *a_zoneAdminFile, char *a_zoneTempDir,
- char *a_altBinDir, char *a_scratchName, zone_state_t a_zoneState,
- boolean_t a_tmpzn)
+ char *a_idsName, char *a_zoneAdminFile, char *a_zoneTempDir,
+ char *a_altBinDir, char *a_scratchName, zone_state_t a_zoneState,
+ boolean_t a_tmpzn)
{
char preinstallcheckPath[PATH_MAX+1];
char zoneStreamName[PATH_MAX] = {'\0'};
@@ -3231,20 +3229,20 @@ pkginstall_check_in_one_zone(char *a_zoneName,
echoDebug(MSG_CHECKINSTALL_PKG_IN_ZONE, pkginst, a_zoneName);
(void) snprintf(preinstallcheckPath, sizeof (preinstallcheckPath),
- "%s/%s.%s.preinstallcheck.txt", a_zoneTempDir, pkginst,
- a_zoneName);
+ "%s/%s.%s.preinstallcheck.txt", a_zoneTempDir, pkginst,
+ a_zoneName);
if (a_idsName == (char *)NULL) {
/* locate temporary stream created earlier */
(void) snprintf(zoneStreamName, sizeof (zoneStreamName),
- "%s/%s.dstream", a_zoneTempDir, pkginst);
+ "%s/%s.dstream", a_zoneTempDir, pkginst);
} else {
(void) snprintf(zoneStreamName, sizeof (zoneStreamName),
- "%s", a_idsName);
+ "%s", a_idsName);
}
echoDebug(DBG_CHECKINSTALL_IN_ZONE, pkginst, a_zoneName,
- zoneStreamName);
+ zoneStreamName);
n = pkgZoneCheckInstall(a_scratchName, a_zoneState, zoneStreamName,
a_altBinDir, a_zoneAdminFile, preinstallcheckPath, a_tmpzn);
@@ -3254,8 +3252,8 @@ pkginstall_check_in_one_zone(char *a_zoneName,
ckreturn(n);
echoDebug(DBG_INSTALL_FLAG_VALUES, "after preinstall check",
- admnflag, doreboot, failflag, interrupted, intrflag,
- ireboot, needconsult, nullflag, warnflag);
+ admnflag, doreboot, failflag, interrupted, intrflag,
+ ireboot, needconsult, nullflag, warnflag);
}
/*
@@ -3283,7 +3281,7 @@ pkginstall_check_in_one_zone(char *a_zoneName,
static int
pkginstall_check_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
- char *a_zoneAdminFile, char *a_zoneTempDir)
+ char *a_zoneAdminFile, char *a_zoneTempDir)
{
char *zoneName;
int zoneIndex;
@@ -3291,8 +3289,8 @@ pkginstall_check_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
zone_state_t zst;
for (zoneIndex = 0;
- (zoneName = z_zlist_get_zonename(a_zlst, zoneIndex)) != NULL;
- zoneIndex++) {
+ (zoneName = z_zlist_get_zonename(a_zlst, zoneIndex)) != NULL;
+ zoneIndex++) {
zst = z_zlist_get_current_state(a_zlst, zoneIndex);
if (zst != ZONE_STATE_RUNNING && zst != ZONE_STATE_MOUNTED) {
@@ -3335,7 +3333,7 @@ pkginstall_check_in_zones(zoneList_t a_zlst, char *a_idsName, char *a_altBinDir,
static int
boot_and_pkginstall_check_in_zones(zoneList_t a_zlst, char *a_idsName,
- char *a_altBinDir, char *a_zoneAdminFile, char *a_zoneTempDir)
+ char *a_altBinDir, char *a_zoneAdminFile, char *a_zoneTempDir)
{
int zoneIndex;
int zonesSkipped = 0;
@@ -3351,13 +3349,13 @@ boot_and_pkginstall_check_in_zones(zoneList_t a_zlst, char *a_idsName,
echoDebug(DBG_BOOTCHECKINSTALLINZONES_ENTRY);
echoDebug(DBG_BOOTCHECKINSTALLINZONES_ARGS, PSTR(a_idsName),
- PSTR(a_zoneAdminFile), PSTR(a_zoneTempDir));
+ PSTR(a_zoneAdminFile), PSTR(a_zoneTempDir));
/* process each zone in the list */
for (zoneIndex = 0;
- (zoneName = z_zlist_get_zonename(a_zlst, zoneIndex)) != NULL;
- zoneIndex++) {
+ (zoneName = z_zlist_get_zonename(a_zlst, zoneIndex)) != NULL;
+ zoneIndex++) {
/* skip the zone if it IS running */
@@ -3419,8 +3417,8 @@ boot_and_pkginstall_check_in_zones(zoneList_t a_zlst, char *a_idsName,
static boolean_t
add_packages_in_global_with_zones(char **a_pkgList,
- char *a_idsName, int a_repeat, char *a_altBinDir,
- char *a_device, zoneList_t a_zlst)
+ char *a_idsName, int a_repeat, char *a_altBinDir,
+ char *a_device, zoneList_t a_zlst)
{
static char *zoneTempDir = (char *)NULL;
static char *zoneAdminFile = (char *)NULL;
@@ -3443,7 +3441,7 @@ static char *zoneAdminFile = (char *)NULL;
echoDebug(DBG_ADDPACKAGES_GZ_W_LZ_ENTRY);
echoDebug(DBG_ADDPACKAGES_GZ_W_LZ_ARGS, npkgs,
- PSTR(a_idsName), a_repeat, PSTR(a_device));
+ PSTR(a_idsName), a_repeat, PSTR(a_device));
/* create temporary directory for use by zone operations */
@@ -3487,10 +3485,10 @@ static char *zoneAdminFile = (char *)NULL;
/* package is not a stream - create one */
(void) snprintf(zoneStreamName, sizeof (zoneStreamName),
- "%s/%s.dstream", zoneTempDir, pkginst);
+ "%s/%s.dstream", zoneTempDir, pkginst);
echoDebug(DBG_CONVERTING_PKG, packageDir, pkginst,
- zoneStreamName);
+ zoneStreamName);
/* set up list of packages to be this package only */
@@ -3498,10 +3496,10 @@ static char *zoneAdminFile = (char *)NULL;
pkgs[1] = (char *)NULL;
n = pkgtrans(packageDir, zoneStreamName, pkgs,
- PT_SILENT|PT_ODTSTREAM);
+ PT_SILENT|PT_ODTSTREAM);
if (n != 0) {
progerr(ERR_CANNOT_CONVERT_PKGSTRM,
- pkginst, packageDir, zoneStreamName);
+ pkginst, packageDir, zoneStreamName);
quit(1);
}
npkgs--;
@@ -3548,8 +3546,8 @@ static char *zoneAdminFile = (char *)NULL;
}
echoDebug(DBG_INSTALL_FLAG_VALUES, "after pkginstall",
- admnflag, doreboot, failflag, interrupted, intrflag,
- ireboot, needconsult, nullflag, warnflag);
+ admnflag, doreboot, failflag, interrupted, intrflag,
+ ireboot, needconsult, nullflag, warnflag);
/*
* call pkginstall to verify this package for all non-global
@@ -3557,7 +3555,7 @@ static char *zoneAdminFile = (char *)NULL;
*/
zonesSkipped = pkginstall_check_in_zones(a_zlst, a_idsName,
- a_altBinDir, admnfile, zoneTempDir);
+ a_altBinDir, admnfile, zoneTempDir);
/*
* if any zones were skipped (becuase they are not currently
@@ -3569,13 +3567,13 @@ static char *zoneAdminFile = (char *)NULL;
echoDebug(DBG_ZONES_SKIPPED, zonesSkipped);
zonesSkipped =
- boot_and_pkginstall_check_in_zones(a_zlst,
- a_idsName, a_altBinDir, admnfile,
- zoneTempDir);
+ boot_and_pkginstall_check_in_zones(a_zlst,
+ a_idsName, a_altBinDir, admnfile,
+ zoneTempDir);
if (zonesSkipped > 0) {
progerr(ERR_INSTALL_ZONES_SKIPPED,
- zonesSkipped);
+ zonesSkipped);
}
}
@@ -3645,7 +3643,7 @@ static char *zoneAdminFile = (char *)NULL;
if ((askflag != 0) && (respdir != (char *)NULL)) {
(void) snprintf(respfile_path, sizeof (respfile_path),
- "%s/%s", respdir, pkginst);
+ "%s/%s", respdir, pkginst);
respfile = respfile_path;
}
@@ -3708,13 +3706,13 @@ static char *zoneAdminFile = (char *)NULL;
}
echoDebug(DBG_INSTALL_FLAG_VALUES, "install in running zones",
- admnflag, doreboot, failflag, interrupted, intrflag,
- ireboot, needconsult, nullflag, warnflag);
+ admnflag, doreboot, failflag, interrupted, intrflag,
+ ireboot, needconsult, nullflag, warnflag);
/* install package in currently booted zones */
zonesSkipped = install_in_zones(a_zlst, a_idsName, a_altBinDir,
- zoneAdminFile, zoneTempDir);
+ zoneAdminFile, zoneTempDir);
/* install package in zones that are not currently booted */
@@ -3722,12 +3720,12 @@ static char *zoneAdminFile = (char *)NULL;
echoDebug(DBG_ZONES_SKIPPED, zonesSkipped);
zonesSkipped = boot_and_install_in_zones(a_zlst,
- a_idsName, a_altBinDir, zoneAdminFile,
- zoneTempDir);
+ a_idsName, a_altBinDir, zoneAdminFile,
+ zoneTempDir);
if (zonesSkipped > 0) {
progerr(ERR_INSTALL_ZONES_SKIPPED,
- zonesSkipped);
+ zonesSkipped);
}
}
@@ -3739,15 +3737,15 @@ static char *zoneAdminFile = (char *)NULL;
if (a_idsName == (char *)NULL) {
/* locate temporary stream created earlier */
(void) snprintf(zoneStreamName, sizeof (zoneStreamName),
- "%s/%s.dstream", zoneTempDir, pkginst);
+ "%s/%s.dstream", zoneTempDir, pkginst);
/* remove stream - no longer needed */
echoDebug(DBG_REMOVING_DSTREAM_PKGDIR, zoneStreamName,
- pkginst);
+ pkginst);
(void) remove(zoneStreamName);
} else {
/* remove package - no longer needed */
if (snprintf(instdir, sizeof (instdir), "%s/%s",
- zoneTempDir, pkginst) >= PATH_MAX) {
+ zoneTempDir, pkginst) >= PATH_MAX) {
progerr(ERR_CANNOT_CREATE_PKGPATH, tmpdir);
quit(1);
}
@@ -3768,7 +3766,7 @@ static char *zoneAdminFile = (char *)NULL;
(void) chdir("/");
if (!a_idsName) {
echoDebug(DBG_UNMOUNTING_DEV,
- PSTR(pkgdev.mount));
+ PSTR(pkgdev.mount));
(void) pkgumount(&pkgdev);
}
}
@@ -3784,7 +3782,7 @@ static char *zoneAdminFile = (char *)NULL;
*/
if ((ireboot == 0) && (a_repeat != 0) &&
- (pkgdev.pathname == (char *)NULL)) {
+ (pkgdev.pathname == (char *)NULL)) {
return (B_TRUE);
}
@@ -3804,7 +3802,7 @@ static char *zoneAdminFile = (char *)NULL;
static boolean_t
add_packages_in_nonglobal_zone(char **a_pkgList,
- char *a_idsName, int a_repeat, char *a_altBinDir, char *a_device)
+ char *a_idsName, int a_repeat, char *a_altBinDir, char *a_device)
{
static char *zoneTempDir = (char *)NULL;
@@ -3823,7 +3821,7 @@ static char *zoneTempDir = (char *)NULL;
echoDebug(DBG_ADDPACKAGES_LZ_ENTRY);
echoDebug(DBG_ADDPACKAGES_LZ_ARGS, npkgs, PSTR(a_idsName),
- a_repeat, PSTR(a_device));
+ a_repeat, PSTR(a_device));
/* create temporary directory for use by zone operations */
@@ -3902,7 +3900,7 @@ static char *zoneTempDir = (char *)NULL;
if ((askflag != 0) && (respdir != (char *)NULL)) {
(void) snprintf(respfile_path, sizeof (respfile_path),
- "%s/%s", respdir, pkginst);
+ "%s/%s", respdir, pkginst);
respfile = respfile_path;
}
@@ -3928,7 +3926,7 @@ static char *zoneTempDir = (char *)NULL;
/* call pkginstall for this package */
n = pkgInstall(get_inst_root(), NULL,
- packageDir, a_altBinDir);
+ packageDir, a_altBinDir);
/* set success/fail condition variables */
@@ -3961,7 +3959,7 @@ static char *zoneTempDir = (char *)NULL;
*/
if ((ireboot == 0) && (a_repeat != 0) &&
- (pkgdev.pathname == (char *)NULL)) {
+ (pkgdev.pathname == (char *)NULL)) {
return (B_TRUE);
}
@@ -3981,7 +3979,7 @@ static char *zoneTempDir = (char *)NULL;
static boolean_t
add_packages_in_global_no_zones(char **a_pkgList,
- char *a_idsName, int a_repeat, char *a_altBinDir, char *a_device)
+ char *a_idsName, int a_repeat, char *a_altBinDir, char *a_device)
{
int n;
int i;
@@ -3994,7 +3992,7 @@ add_packages_in_global_no_zones(char **a_pkgList,
echoDebug(DBG_ADDPACKAGES_GZ_NO_LZ_ENTRY);
echoDebug(DBG_ADDPACKAGES_GZ_NO_LZ_ARGS, npkgs,
- PSTR(a_idsName), a_repeat, PSTR(a_device));
+ PSTR(a_idsName), a_repeat, PSTR(a_device));
/*
* set flags for applicability check
@@ -4039,7 +4037,7 @@ add_packages_in_global_no_zones(char **a_pkgList,
*/
if (check_applicability(pkgdev.dirname,
- pkginst, get_inst_root(), flags) == B_FALSE) {
+ pkginst, get_inst_root(), flags) == B_FALSE) {
progerr(ERR_PKG_NOT_APPLICABLE, pkginst);
quit(1);
}
@@ -4054,7 +4052,7 @@ add_packages_in_global_no_zones(char **a_pkgList,
if ((askflag != 0) && (respdir != (char *)NULL)) {
(void) snprintf(respfile_path, sizeof (respfile_path),
- "%s/%s", respdir, pkginst);
+ "%s/%s", respdir, pkginst);
respfile = respfile_path;
}
@@ -4080,7 +4078,7 @@ add_packages_in_global_no_zones(char **a_pkgList,
/* call pkginstall for this package */
n = pkgInstall(get_inst_root(), a_idsName,
- pkgdev.dirname, a_altBinDir);
+ pkgdev.dirname, a_altBinDir);
/* set success/fail condition variables */
@@ -4113,7 +4111,7 @@ add_packages_in_global_no_zones(char **a_pkgList,
*/
if ((ireboot == 0) && (a_repeat != 0) &&
- (pkgdev.pathname == (char *)NULL)) {
+ (pkgdev.pathname == (char *)NULL)) {
return (B_TRUE);
}
@@ -4130,8 +4128,8 @@ add_packages_in_global_no_zones(char **a_pkgList,
static boolean_t
add_packages(char **a_pkgList,
- char *a_idsName, int a_repeat, char *a_altBinDir, char *a_device,
- boolean_t a_noZones)
+ char *a_idsName, int a_repeat, char *a_altBinDir, char *a_device,
+ boolean_t a_noZones)
{
zoneList_t zlst;
boolean_t b;
@@ -4142,7 +4140,7 @@ add_packages(char **a_pkgList,
echoDebug(DBG_ADDPACKAGES_ENTRY);
echoDebug(DBG_ADDPACKAGES_ARGS, npkgs, PSTR(a_idsName),
- a_repeat, PSTR(a_altBinDir), PSTR(a_device));
+ a_repeat, PSTR(a_altBinDir), PSTR(a_device));
/*
* if running in the global zone AND one or more non-global
@@ -4164,7 +4162,7 @@ add_packages(char **a_pkgList,
}
b = add_packages_in_nonglobal_zone(a_pkgList, a_idsName,
- a_repeat, a_altBinDir, a_device);
+ a_repeat, a_altBinDir, a_device);
(void) z_unlock_this_zone(ZLOCKS_ALL);
@@ -4175,7 +4173,7 @@ add_packages(char **a_pkgList,
b = z_non_global_zones_exist();
if ((a_noZones == B_FALSE) && (b == B_TRUE) &&
- (globalZoneOnly == B_FALSE)) {
+ (globalZoneOnly == B_FALSE)) {
echoDebug(DBG_IN_GZ_WITH_LZ);
@@ -4208,7 +4206,7 @@ add_packages(char **a_pkgList,
/* add packages to all zones */
b = add_packages_in_global_with_zones(a_pkgList,
- a_idsName, a_repeat, a_altBinDir, a_device, zlst);
+ a_idsName, a_repeat, a_altBinDir, a_device, zlst);
/* unlock all zones */
@@ -4235,7 +4233,7 @@ add_packages(char **a_pkgList,
}
b = add_packages_in_global_no_zones(a_pkgList, a_idsName,
- a_repeat, a_altBinDir, a_device);
+ a_repeat, a_altBinDir, a_device);
(void) z_unlock_this_zone(ZLOCKS_ALL);
diff --git a/usr/src/cmd/svr4pkg/pkgadm/lock.c b/usr/src/cmd/svr4pkg/pkgadm/lock.c
index 7832cd3eae..df0232ee8f 100644
--- a/usr/src/cmd/svr4pkg/pkgadm/lock.c
+++ b/usr/src/cmd/svr4pkg/pkgadm/lock.c
@@ -2065,8 +2065,6 @@ _getUniqueId(void)
{
char newkey[LOCK_KEY_MAXLEN];
hrtime_t hretime;
- int b;
- int execStatus;
struct tm tstruct;
time_t thetime;
diff --git a/usr/src/cmd/svr4pkg/pkgadm/main.c b/usr/src/cmd/svr4pkg/pkgadm/main.c
index cd07946284..4ad670d725 100644
--- a/usr/src/cmd/svr4pkg/pkgadm/main.c
+++ b/usr/src/cmd/svr4pkg/pkgadm/main.c
@@ -75,7 +75,7 @@ struct cmd cmds[] = {
int
main(int argc, char **argv)
{
- char cur_cmd;
+ int cur_cmd;
int newargc;
char **newargv;
int i;
diff --git a/usr/src/cmd/svr4pkg/pkgcond/main.c b/usr/src/cmd/svr4pkg/pkgcond/main.c
index 2cf036a790..e3f5ac723d 100644
--- a/usr/src/cmd/svr4pkg/pkgcond/main.c
+++ b/usr/src/cmd/svr4pkg/pkgcond/main.c
@@ -20,6 +20,10 @@
*/
/*
+ * Copyright (c) 2017 Peter Tribble.
+ */
+
+/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -351,7 +355,7 @@ main(int argc, char **argv)
case 'O':
for (p = strtok(optarg, ","); p != NULL;
- p = strtok(NULL, ",")) {
+ p = strtok(NULL, ",")) {
/* debug - enable all tracing */
@@ -413,7 +417,7 @@ main(int argc, char **argv)
if (parseGlobalData(PKGCOND_GLOBAL_VARIABLE, &gdt) != R_SUCCESS) {
log_msg(LOG_MSG_ERR, ERR_CANNOT_USE_GLOBAL_DATA,
- PKGCOND_GLOBAL_VARIABLE);
+ PKGCOND_GLOBAL_VARIABLE);
return (R_ERROR);
}
@@ -421,7 +425,7 @@ main(int argc, char **argv)
(strcmp(gdt->gd_installRoot, "/") == 0) ? NULL :
ENV_VAR_SET, B_TRUE) != R_SUCCESS) {
log_msg(LOG_MSG_ERR, ERR_CANNOT_SET_ROOT_PATH,
- ENV_VAR_PKGROOT);
+ ENV_VAR_PKGROOT);
return (R_ERROR);
}
@@ -611,7 +615,7 @@ static int recursion = 0;
if (pkgTestInstalled("SUNWdclnt", "/") != B_TRUE) {
log_msg(LOG_MSG_DEBUG, DBG_IDLC_PKG_NOT_INSTALLED,
- rootPath, "SUNWdclnt", "/");
+ rootPath, "SUNWdclnt", "/");
return (R_FAILURE);
}
@@ -626,7 +630,7 @@ static int recursion = 0;
if (strcmp(a_gdt->gd_zoneName, GLOBAL_ZONENAME) != 0) {
log_msg(LOG_MSG_DEBUG, DBG_IDLC_ZONE_BAD, rootPath,
- GLOBAL_ZONENAME);
+ GLOBAL_ZONENAME);
return (R_FAILURE);
}
@@ -637,7 +641,7 @@ static int recursion = 0;
*/
(void) snprintf(cmd, sizeof (cmd), "%s %s >/dev/null 2>&1",
- LS_CMD, "/export/exec/Solaris_*/usr");
+ LS_CMD, "/export/exec/Solaris_*/usr");
/* execute command */
@@ -647,7 +651,7 @@ static int recursion = 0;
if (rc != 0) {
log_msg(LOG_MSG_DEBUG, DBG_IDLC_PATH_MISSING,
- rootPath, "/export/exec/Solaris_*/usr");
+ rootPath, "/export/exec/Solaris_*/usr");
return (R_FAILURE);
}
@@ -657,7 +661,7 @@ static int recursion = 0;
* /usr/bin/ls -d1 $ROOTDIR/usr/\*
*/
(void) snprintf(cmd, sizeof (cmd), "%s %s %s/%s >/dev/null 2>&1",
- LS_CMD, "-1d", rootPath, "usr/*");
+ LS_CMD, "-1d", rootPath, "usr/*");
/* execute command */
@@ -667,17 +671,17 @@ static int recursion = 0;
if (rc == 0) {
log_msg(LOG_MSG_DEBUG, DBG_IDLC_USR_IS_NOT_EMPTY,
- rootPath);
+ rootPath);
return (R_FAILURE);
}
/* there must be a templates directory at ${ROOTPATH}/../templates */
r = testPath(TEST_EXISTS|TEST_IS_DIRECTORY,
- "%s/%s", rootPath, "../templates");
+ "%s/%s", rootPath, "../templates");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_IDLC_NO_TEMPLATES_PATH,
- rootPath, rootPath, "../templates");
+ rootPath, rootPath, "../templates");
return (R_FAILURE);
}
@@ -856,7 +860,7 @@ static int recursion = 0;
/* the path is a global zone */
log_msg(LOG_MSG_DEBUG, DBG_ISGZ_PATH_IS_GLOBAL_ZONE,
- rootPath);
+ rootPath);
return (R_SUCCESS);
}
@@ -868,7 +872,7 @@ static int recursion = 0;
/* the path is a global zone */
log_msg(LOG_MSG_DEBUG, DBG_ISGZ_PATH_IS_GLOBAL_ZONE,
- rootPath);
+ rootPath);
return (R_SUCCESS);
}
@@ -876,7 +880,7 @@ static int recursion = 0;
/* inside a non-global zone */
log_msg(LOG_MSG_DEBUG, DBG_ISGZ_ZONENAME_ISNT_GLOBAL,
- rootPath, a_gdt->gd_zoneName);
+ rootPath, a_gdt->gd_zoneName);
return (R_FAILURE);
}
@@ -893,30 +897,30 @@ static int recursion = 0;
/* not global zone if /etc/zones does not exist */
r = testPath(TEST_EXISTS|TEST_IS_DIRECTORY,
- "%s/%s", rootPath, "/etc/zones");
+ "%s/%s", rootPath, "/etc/zones");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_ISGZ_PATH_ISNT_DIRECTORY,
- rootPath, "/etc/zones");
+ rootPath, "/etc/zones");
return (R_FAILURE);
}
/* .tmp_proto must not exist */
r = testPath(TEST_NOT_EXISTS,
- "%s/%s", rootPath, ".tmp_proto");
+ "%s/%s", rootPath, ".tmp_proto");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_ISGZ_PATH_EXISTS,
- rootPath, "/.tmp_proto");
+ rootPath, "/.tmp_proto");
return (R_FAILURE);
}
/* /var must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/var");
+ "%s/%s", rootPath, "/var");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_ISGZ_PATH_IS_SYMLINK,
- rootPath, "/var");
+ rootPath, "/var");
return (R_FAILURE);
}
@@ -1030,7 +1034,7 @@ static int recursion = 0;
if (strcmp(a_gdt->gd_zoneName, GLOBAL_ZONENAME) != 0) {
log_msg(LOG_MSG_DEBUG, DBG_INIM_BAD_CURRENT_ZONE,
- rootPath, GLOBAL_ZONENAME);
+ rootPath, GLOBAL_ZONENAME);
return (R_FAILURE);
}
@@ -1038,47 +1042,47 @@ static int recursion = 0;
if (cmd_is_mounted_miniroot(argc, argv, a_gdt) == R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_IMRT_PATH_IS_MOUNTED_MINIROOT,
- rootPath);
+ rootPath);
return (R_FAILURE);
}
/* $ROOTDIR/.tmp_proto exists */
r = testPath(TEST_EXISTS|TEST_IS_DIRECTORY,
- "%s/%s", rootPath, ".tmp_proto");
+ "%s/%s", rootPath, ".tmp_proto");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_INIM_PATH_ISNT_DIRECTORY,
- rootPath, "/.tmp_proto");
+ rootPath, "/.tmp_proto");
return (R_FAILURE);
}
/* $ROOTDIR/var is a symbolic link */
r = testPath(TEST_IS_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/var");
+ "%s/%s", rootPath, "/var");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_INIM_PATH_ISNT_SYMLINK,
- rootPath, "/var");
+ rootPath, "/var");
return (R_FAILURE);
}
/* $ROOTDIR/tmp/kernel does exist */
r = testPath(TEST_EXISTS|TEST_IS_DIRECTORY,
- "%s/%s", rootPath, "/tmp/kernel");
+ "%s/%s", rootPath, "/tmp/kernel");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_INIM_PATH_ISNT_DIRECTORY,
- rootPath, "/tmp/kernel");
+ rootPath, "/tmp/kernel");
return (R_FAILURE);
}
/* $ROOTDIR/.tmp_proto/kernel is a symbolic link */
r = testPath(TEST_IS_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/.tmp_proto/kernel");
+ "%s/%s", rootPath, "/.tmp_proto/kernel");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_INIM_PATH_ISNT_SYMLINK,
- rootPath, "/.tmp_proto/kernel");
+ rootPath, "/.tmp_proto/kernel");
return (R_FAILURE);
}
@@ -1188,27 +1192,27 @@ static int recursion = 0;
if (strcmp(a_gdt->gd_zoneName, GLOBAL_ZONENAME) != 0) {
log_msg(LOG_MSG_DEBUG, DBG_IMRT_BAD_CURRENT_ZONE,
- rootPath, GLOBAL_ZONENAME);
+ rootPath, GLOBAL_ZONENAME);
return (R_FAILURE);
}
/* $ROOTDIR/tmp/kernel is a symbolic link */
r = testPath(TEST_IS_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/tmp/kernel");
+ "%s/%s", rootPath, "/tmp/kernel");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_IMRT_PATH_ISNT_SYMLINK,
- rootPath, "/tmp/kernel");
+ rootPath, "/tmp/kernel");
return (R_FAILURE);
}
/* $ROOTDIR/tmp/root/kernel is a directory */
r = testPath(TEST_EXISTS|TEST_IS_DIRECTORY,
- "%s/%s", rootPath, "/tmp/root/kernel");
+ "%s/%s", rootPath, "/tmp/root/kernel");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_IMRT_PATH_ISNT_DIRECTORY,
- rootPath, "/tmp/root/kernel");
+ rootPath, "/tmp/root/kernel");
return (R_FAILURE);
}
@@ -1316,7 +1320,7 @@ static int recursion = 0;
if ((a_gdt->gd_nonglobalZoneInstall == B_TRUE) &&
(strcmp(a_gdt->gd_installRoot, rootPath) == 0)) {
log_msg(LOG_MSG_DEBUG, DBG_NGZN_INSTALL_ZONENAME_IS_NGZ,
- rootPath, a_gdt->gd_zoneName);
+ rootPath, a_gdt->gd_zoneName);
return (R_SUCCESS);
}
@@ -1352,12 +1356,12 @@ static int recursion = 0;
if (strcmp(a_gdt->gd_zoneName, GLOBAL_ZONENAME) == 0) {
/* in the global zone */
log_msg(LOG_MSG_DEBUG, DBG_NGZN_ZONENAME_ISNT_NGZ,
- rootPath, a_gdt->gd_zoneName);
+ rootPath, a_gdt->gd_zoneName);
return (R_FAILURE);
}
/* in a non-global zone */
log_msg(LOG_MSG_DEBUG, DBG_NGZN_ZONENAME_IS_NGZ,
- rootPath, a_gdt->gd_zoneName);
+ rootPath, a_gdt->gd_zoneName);
return (R_SUCCESS);
}
@@ -1401,29 +1405,29 @@ static int recursion = 0;
if (r != R_SUCCESS) {
/* $R/.tmp_proto cannot exist in a non-global zone */
log_msg(LOG_MSG_DEBUG, DBG_NGZN_PATH_EXISTS,
- rootPath, "/.tmp_proto");
+ rootPath, "/.tmp_proto");
return (R_FAILURE);
}
/* /var must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/var");
+ "%s/%s", rootPath, "/var");
if (r != R_SUCCESS) {
/* $R/var cannot be a symbolic link in a non-global zone */
log_msg(LOG_MSG_DEBUG, DBG_NGZN_PATH_DOES_NOT_EXIST,
- rootPath, "/var");
+ rootPath, "/var");
return (R_FAILURE);
}
/* $ROOTDIR/tmp/root/kernel must not exist */
r = testPath(TEST_NOT_EXISTS,
- "%s/%s", rootPath, "/tmp/root/kernel");
+ "%s/%s", rootPath, "/tmp/root/kernel");
if (r != R_SUCCESS) {
/* $R/tmp/root/kernel cannot exist in a non-global zone */
log_msg(LOG_MSG_DEBUG, DBG_NGZN_PATH_EXISTS,
- rootPath, "/tmp/root/kernel");
+ rootPath, "/tmp/root/kernel");
return (R_FAILURE);
}
@@ -1439,7 +1443,7 @@ static int recursion = 0;
if (strcmp(a_gdt->gd_zoneName, GLOBAL_ZONENAME) == 0) {
/* in the global zone */
log_msg(LOG_MSG_DEBUG, DBG_NGZN_IN_GZ_IS_NONGLOBAL_ZONE,
- rootPath);
+ rootPath);
return (R_SUCCESS);
}
@@ -1461,12 +1465,12 @@ static int recursion = 0;
*/
if ((a_gdt->gd_parentZoneName != NULL) &&
- (a_gdt->gd_currentZoneName != NULL) &&
- (strcmp(a_gdt->gd_parentZoneName,
- a_gdt->gd_currentZoneName) == 0)) {
+ (a_gdt->gd_currentZoneName != NULL) &&
+ (strcmp(a_gdt->gd_parentZoneName,
+ a_gdt->gd_currentZoneName) == 0)) {
/* parent and current zone name identical: non-gz */
log_msg(LOG_MSG_DEBUG, DBG_NGZN_PARENT_CHILD_SAMEZONE,
- rootPath, a_gdt->gd_parentZoneName);
+ rootPath, a_gdt->gd_parentZoneName);
return (R_SUCCESS);
}
@@ -1491,18 +1495,18 @@ static int recursion = 0;
/* if defined, parent zone type must be "global" */
if ((a_gdt->gd_parentZoneType != NULL) &&
- (strcmp(a_gdt->gd_parentZoneType, "nonglobal") == 0)) {
+ (strcmp(a_gdt->gd_parentZoneType, "nonglobal") == 0)) {
log_msg(LOG_MSG_DEBUG, DBG_NGZN_BAD_PARENT_ZONETYPE,
- rootPath, "nonglobal");
+ rootPath, "nonglobal");
return (R_FAILURE);
}
/* if defined, current zone type must be "nonglobal" */
if ((a_gdt->gd_currentZoneType != NULL) &&
- (strcmp(a_gdt->gd_currentZoneType, GLOBAL_ZONENAME) == 0)) {
+ (strcmp(a_gdt->gd_currentZoneType, GLOBAL_ZONENAME) == 0)) {
log_msg(LOG_MSG_DEBUG, DBG_NGZN_BAD_CURRENT_ZONETYPE,
- rootPath, GLOBAL_ZONENAME);
+ rootPath, GLOBAL_ZONENAME);
return (R_FAILURE);
}
@@ -1623,7 +1627,7 @@ static int recursion = 0;
if (strcmp(a_gdt->gd_zoneName, GLOBAL_ZONENAME) != 0) {
log_msg(LOG_MSG_DEBUG, DBG_IRST_ZONE_BAD, rootPath,
- GLOBAL_ZONENAME);
+ GLOBAL_ZONENAME);
return (R_FAILURE);
}
@@ -1757,30 +1761,30 @@ static int recursion = 0;
/* /etc must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/etc");
+ "%s/%s", rootPath, "/etc");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_ADDV_PATH_IS_SYMLINK,
- rootPath, "/etc");
+ rootPath, "/etc");
return (R_FAILURE);
}
/* /platform must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/platform");
+ "%s/%s", rootPath, "/platform");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_ADDV_PATH_IS_SYMLINK,
- rootPath, "/platform");
+ rootPath, "/platform");
return (R_FAILURE);
}
/* /kernel must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/kernel");
+ "%s/%s", rootPath, "/kernel");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_ADDV_PATH_IS_SYMLINK,
- rootPath, "/kernel");
+ rootPath, "/kernel");
return (R_FAILURE);
}
@@ -1896,30 +1900,30 @@ static int recursion = 0;
/* /etc must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/etc");
+ "%s/%s", rootPath, "/etc");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_UPDV_PATH_IS_SYMLINK,
- rootPath, "/etc");
+ rootPath, "/etc");
return (R_FAILURE);
}
/* /platform must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/platform");
+ "%s/%s", rootPath, "/platform");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_UPDV_PATH_IS_SYMLINK,
- rootPath, "/platform");
+ rootPath, "/platform");
return (R_FAILURE);
}
/* /kernel must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/kernel");
+ "%s/%s", rootPath, "/kernel");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_UPDV_PATH_IS_SYMLINK,
- rootPath, "/kernel");
+ rootPath, "/kernel");
return (R_FAILURE);
}
@@ -2035,30 +2039,30 @@ static int recursion = 0;
/* /etc must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/etc");
+ "%s/%s", rootPath, "/etc");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_RMDV_PATH_IS_SYMLINK,
- rootPath, "/etc");
+ rootPath, "/etc");
return (R_FAILURE);
}
/* /platform must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/platform");
+ "%s/%s", rootPath, "/platform");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_RMDV_PATH_IS_SYMLINK,
- rootPath, "/platform");
+ rootPath, "/platform");
return (R_FAILURE);
}
/* /kernel must exist and must not be a symbolic link */
r = testPath(TEST_EXISTS|TEST_NOT_SYMBOLIC_LINK,
- "%s/%s", rootPath, "/kernel");
+ "%s/%s", rootPath, "/kernel");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_RMDV_PATH_IS_SYMLINK,
- rootPath, "/kernel");
+ rootPath, "/kernel");
return (R_FAILURE);
}
@@ -2169,8 +2173,8 @@ static int recursion = 0;
}
log_msg(LOG_MSG_DEBUG, DBG_PWRT_INFO,
- rootPath, list[nn].fsi_mntPoint, list[nn].fsi_fsType,
- list[nn].fsi_mntOptions);
+ rootPath, list[nn].fsi_mntPoint, list[nn].fsi_fsType,
+ list[nn].fsi_mntOptions);
/*
* need to determine if the mount point is writeable:
@@ -2181,7 +2185,7 @@ static int recursion = 0;
r = mountOptionPresent(list[nn].fsi_mntOptions, MNTOPT_RO);
if (r == R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_PWRT_READONLY,
- rootPath, list[nn].fsi_mntOptions);
+ rootPath, list[nn].fsi_mntOptions);
return (R_FAILURE);
}
@@ -2348,10 +2352,10 @@ static int recursion = 0;
/* /var must exist */
r = testPath(TEST_EXISTS,
- "%s/%s", rootPath, "/var");
+ "%s/%s", rootPath, "/var");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_IALR_PATH_DOES_NOT_EXIST,
- rootPath, "/var");
+ rootPath, "/var");
return (R_FAILURE);
}
@@ -2497,7 +2501,7 @@ static int recursion = 0;
if (strcmp(a_gdt->gd_zoneName, GLOBAL_ZONENAME) != 0) {
log_msg(LOG_MSG_DEBUG, DBG_BENV_BAD_ZONE, rootPath,
- GLOBAL_ZONENAME);
+ GLOBAL_ZONENAME);
return (R_FAILURE);
}
@@ -2506,14 +2510,14 @@ static int recursion = 0;
r = testPath(TEST_EXISTS, "%s/%s", rootPath, "/etc/lutab");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_BENV_NO_ETCLUTAB, rootPath,
- "/etc/lutab");
+ "/etc/lutab");
return (R_FAILURE);
}
/* $ROOTDIR/etc/lu must exist */
r = testPath(TEST_EXISTS|TEST_IS_DIRECTORY,
- "%s/%s", rootPath, "/etc/lu");
+ "%s/%s", rootPath, "/etc/lu");
if (r != R_SUCCESS) {
log_msg(LOG_MSG_DEBUG, DBG_BENV_NO_ETCLU, rootPath, "/etc/lu");
return (R_FAILURE);
@@ -2635,7 +2639,7 @@ static char *cmdName = "is_what";
result = adjustResults(result);
log_msg(LOG_MSG_INFO, MSG_IS_WHAT_RESULT,
- cmds[cur_cmd].c_name, result);
+ cmds[cur_cmd].c_name, result);
}
return (R_SUCCESS);
}
@@ -2758,7 +2762,7 @@ mountOptionPresent(char *a_mntOptions, char *a_opt)
static void
sortedInsert(FSI_T **r_list, long *a_listSize, char *a_mntPoint,
- char *a_fsType, char *a_mntOptions)
+ char *a_fsType, char *a_mntOptions)
{
int listSize;
FSI_T *list;
@@ -2824,7 +2828,7 @@ sortedInsert(FSI_T **r_list, long *a_listSize, char *a_mntPoint,
/* entry already in list -- merge entries */
len = strlen(list[n].fsi_mntOptions) +
- strlen(a_mntOptions) + 2;
+ strlen(a_mntOptions) + 2;
me = (char *)calloc(1, len);
/* merge two mount options lists into one */
@@ -2839,9 +2843,9 @@ sortedInsert(FSI_T **r_list, long *a_listSize, char *a_mntPoint,
list[n].fsi_mntOptions = me;
echoDebug(DBG_SORTEDINS_SKIPPED,
- n, list[n].fsi_mntPoint, a_fsType,
- list[n].fsi_fsType, a_mntOptions,
- list[n].fsi_mntOptions);
+ n, list[n].fsi_mntPoint, a_fsType,
+ list[n].fsi_fsType, a_mntOptions,
+ list[n].fsi_mntOptions);
continue;
} else if (c < 0) {
@@ -2856,9 +2860,9 @@ sortedInsert(FSI_T **r_list, long *a_listSize, char *a_mntPoint,
/* allocate one more entry and make space for new entry */
listSize++;
list = (FSI_T *)realloc(list,
- sizeof (FSI_T)*(listSize+1));
+ sizeof (FSI_T)*(listSize+1));
(void) memmove(&(list[n+1]), &(list[n]),
- sizeof (FSI_T)*(listSize-n));
+ sizeof (FSI_T)*(listSize-n));
/* insert this entry into list */
list[n].fsi_mntPoint = strdup(a_mntPoint);
@@ -2936,9 +2940,10 @@ calculateFileSystemConfig(GLOBALDATA_T *a_gdt)
while (getmntent(fp, &mntbuf) == 0) {
if (mntbuf.mnt_mountp[0] == '/') {
sortedInsert(&list, &listSize,
- strdup(mntbuf.mnt_mountp),
- strdup(mntbuf.mnt_fstype),
- strdup(mntbuf.mnt_mntopts ? mntbuf.mnt_mntopts : ""));
+ strdup(mntbuf.mnt_mountp),
+ strdup(mntbuf.mnt_fstype),
+ strdup(mntbuf.mnt_mntopts ?
+ mntbuf.mnt_mntopts : ""));
}
/*
@@ -2947,8 +2952,8 @@ calculateFileSystemConfig(GLOBALDATA_T *a_gdt)
*/
if (strcmp(mntbuf.mnt_mountp, "/a") == 0 &&
- strcmp(mntbuf.mnt_special, "/a") == 0 &&
- strcmp(mntbuf.mnt_fstype, "lofs") == 0) {
+ strcmp(mntbuf.mnt_special, "/a") == 0 &&
+ strcmp(mntbuf.mnt_fstype, "lofs") == 0) {
a_gdt->inMountedState = B_TRUE;
}
@@ -3000,7 +3005,7 @@ adjustResults(int a_result)
/* debugging output */
log_msg(LOG_MSG_DEBUG, DBG_ADJUST_RESULTS, a_result, negate,
- realResult);
+ realResult);
/* return results */
@@ -3075,7 +3080,7 @@ setRootPath(char *a_path, char *a_envVar, boolean_t a_mustExist)
if (a_mustExist == B_TRUE) {
/* must exist ... error */
log_msg(LOG_MSG_ERR, ERR_DEFAULT_ROOT_INVALID,
- a_path, strerror(errno));
+ a_path, strerror(errno));
return (R_ERROR);
} else {
/* may not exist - use path as specified */
@@ -3095,7 +3100,7 @@ setRootPath(char *a_path, char *a_envVar, boolean_t a_mustExist)
if (stat(rp, &statbuf) != 0) {
log_msg(LOG_MSG_ERR, ERR_DEFAULT_ROOT_INVALID,
- rp, strerror(errno));
+ rp, strerror(errno));
return (R_ERROR);
}
@@ -3195,7 +3200,7 @@ testPath(TEST_TYPES a_tt, char *a_format, ...)
if (lstat(mbPath, &statbuf) != 0) {
echoDebug(DBG_CANNOT_LSTAT_PATH, mbPath,
- strerror(errno));
+ strerror(errno));
free(mbPath);
return (R_FAILURE);
}
@@ -3413,7 +3418,8 @@ findToken(char *path, char *token)
}
while (fgets(line, sizeof (line), fp) != NULL) {
- for (cp = line; *cp && isspace(*cp); cp++);
+ for (cp = line; *cp && isspace(*cp); cp++)
+ ;
/* skip comments */
if (*cp == '#') {
continue;
@@ -3482,7 +3488,7 @@ resolvePath(char **r_path)
mbPathlen = strlen(*r_path);
if ((wcPath = (wchar_t *)
- calloc(1, sizeof (wchar_t)*(mbPathlen+1))) == NULL) {
+ calloc(1, sizeof (wchar_t)*(mbPathlen+1))) == NULL) {
return (R_FAILURE);
}
@@ -3631,7 +3637,7 @@ static char zoneName[ZONENAME_MAX] = { '\0' };
if (zoneName[0] == '\0') {
if (getzonenamebyid(getzoneid(), zoneName,
- sizeof (zoneName)) < 0) {
+ sizeof (zoneName)) < 0) {
log_msg(LOG_MSG_ERR, ERR_CANNOT_GET_ZONENAME);
return (R_ERROR);
}
@@ -3695,7 +3701,7 @@ static void
setNegateResults(boolean_t setting)
{
log_msg(LOG_MSG_DEBUG, DBG_SET_NEGATE_RESULTS,
- _negateResults, setting);
+ _negateResults, setting);
_negateResults = setting;
}
@@ -3770,7 +3776,7 @@ usage(char *a_format, ...)
(void) strlcat(cmdlst, cmds[cur_cmd].c_name, sizeof (cmdlst));
if (cmds[cur_cmd].c_args != NULL) {
(void) strlcat(cmdlst, cmds[cur_cmd].c_args,
- sizeof (cmdlst));
+ sizeof (cmdlst));
}
(void) strlcat(cmdlst, "\n", sizeof (cmdlst));
}
@@ -3799,7 +3805,6 @@ static int
parseGlobalData(char *a_envVar, GLOBALDATA_T **r_gdt)
{
int r;
- int n;
char *a;
SML_TAG *tag;
SML_TAG *ntag;
@@ -3912,7 +3917,7 @@ parseGlobalData(char *a_envVar, GLOBALDATA_T **r_gdt)
ntag = smlGetTagByName(tag, 0, TAG_COND_TOPLEVEL);
if (ntag == SML_TAG__NULL) {
log_msg(LOG_MSG_WRN, WRN_PARSED_DATA_MISSING,
- TAG_COND_TOPLEVEL);
+ TAG_COND_TOPLEVEL);
return (R_FAILURE);
}
@@ -3933,13 +3938,13 @@ parseGlobalData(char *a_envVar, GLOBALDATA_T **r_gdt)
/* current zone name */
a = smlGetParamByTag(ntag, 0, TAG_COND_CURRENT_ZONE,
- TAG_COND_ZONE_NAME);
+ TAG_COND_ZONE_NAME);
(*r_gdt)->gd_currentZoneName = a;
/* current zone type */
a = smlGetParamByTag(ntag, 0, TAG_COND_CURRENT_ZONE,
- TAG_COND_ZONE_TYPE);
+ TAG_COND_ZONE_TYPE);
(*r_gdt)->gd_currentZoneType = a;
return (R_SUCCESS);
@@ -3964,11 +3969,11 @@ dumpGlobalData(GLOBALDATA_T *a_gdt)
echoDebug(DBG_DUMP_GLOBAL_ENTRY);
echoDebug(DBG_DUMP_GLOBAL_PARENT_ZONE,
- a_gdt->gd_parentZoneName ? a_gdt->gd_parentZoneName : "",
- a_gdt->gd_parentZoneType ? a_gdt->gd_parentZoneType : "");
+ a_gdt->gd_parentZoneName ? a_gdt->gd_parentZoneName : "",
+ a_gdt->gd_parentZoneType ? a_gdt->gd_parentZoneType : "");
echoDebug(DBG_DUMP_GLOBAL_CURRENT_ZONE,
- a_gdt->gd_currentZoneName ? a_gdt->gd_currentZoneName : "",
- a_gdt->gd_currentZoneType ? a_gdt->gd_currentZoneType : "");
+ a_gdt->gd_currentZoneName ? a_gdt->gd_currentZoneName : "",
+ a_gdt->gd_currentZoneType ? a_gdt->gd_currentZoneType : "");
}
diff --git a/usr/src/cmd/svr4pkg/pkginfo/pkginfo.c b/usr/src/cmd/svr4pkg/pkginfo/pkginfo.c
index b26bb74350..cdb0397015 100644
--- a/usr/src/cmd/svr4pkg/pkginfo/pkginfo.c
+++ b/usr/src/cmd/svr4pkg/pkginfo/pkginfo.c
@@ -20,6 +20,10 @@
*/
/*
+ * Copyright (c) 2017 Peter Tribble.
+ */
+
+/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -176,42 +180,42 @@ main(int argc, char **argv)
while ((c = getopt(argc, argv, "LNR:xv:a:d:qrpilc:?")) != EOF) {
switch (c) {
- case 'v':
+ case 'v':
ckvers = optarg;
break;
- case 'a':
+ case 'a':
ckarch = optarg;
break;
- case 'd':
+ case 'd':
/* -d could specify stream or mountable device */
device = flex_device(optarg, 1);
break;
- case 'q':
+ case 'q':
qflag++;
break;
- case 'i':
+ case 'i':
iflag = 1;
if (pflag > 0)
usage();
pflag = 0;
break;
- case 'p':
+ case 'p':
pflag = 1;
if (iflag > 0)
usage();
iflag = 0;
break;
- case 'N':
+ case 'N':
Nflag++;
break;
- case 'L':
+ case 'L':
if (xflag || lflag || rflag) {
progerr(gettext(ERR_INCOMP0));
usage();
@@ -219,7 +223,7 @@ main(int argc, char **argv)
Lflag++;
break;
- case 'l':
+ case 'l':
if (xflag || rflag) {
progerr(gettext(ERR_INCOMP1));
usage();
@@ -227,7 +231,7 @@ main(int argc, char **argv)
lflag++;
break;
- case 'x':
+ case 'x':
/* bug # 1081606 */
if (lflag || rflag) {
progerr(gettext(ERR_INCOMP2));
@@ -236,7 +240,7 @@ main(int argc, char **argv)
xflag++;
break;
- case 'r':
+ case 'r':
if (lflag || xflag || Lflag) {
progerr(gettext(ERR_INCOMP0));
usage();
@@ -244,21 +248,21 @@ main(int argc, char **argv)
rflag++;
break;
- case 'c':
+ case 'c':
ckcatg[ncatg++] = strtok(optarg, " \t\n, ");
while (ckcatg[ncatg] = strtok(NULL, " \t\n, "))
ncatg++;
break;
/* added for newroot functions */
- case 'R':
+ case 'R':
if (!set_inst_root(optarg)) {
progerr(gettext(ERR_ROOT_CMD));
exit(1);
}
break;
- default:
+ default:
usage();
}
}
@@ -370,9 +374,9 @@ report(void)
}
if (!pflag &&
+ (choice->partial || (info.status == PI_PARTIAL) ||
+ (info.status == PI_UNKNOWN))) {
/* don't include partially installed packages */
- (choice->partial || (info.status == PI_PARTIAL) ||
- (info.status == PI_UNKNOWN))) {
choice->installed = (-1);
continue;
}
@@ -599,7 +603,6 @@ static void
look_for_installed(void)
{
struct dirent *drp;
- struct stat status;
DIR *dirfp;
char path[PATH_MAX];
@@ -694,7 +697,7 @@ getinfo(struct cfstat *dp)
VFP_T *vfp;
(void) snprintf(pkgmap, sizeof (pkgmap),
- "%s/%s/pkgmap", pkgdir, dp->pkginst);
+ "%s/%s/pkgmap", pkgdir, dp->pkginst);
if (vfpOpen(&vfp, pkgmap, "r", VFP_NEEDNOW) != 0) {
progerr(gettext("unable open \"%s\" for reading"), pkgmap);
@@ -738,7 +741,7 @@ pkgusage(struct cfstat *dp, struct cfent *pentry)
if (pentry->ainfo.mode & 06000)
dp->setuid++;
if (!strchr("dxcbp", pentry->ftype) &&
- (pentry->ainfo.mode & 0111))
+ (pentry->ainfo.mode & 0111))
dp->exec++;
}
}
diff --git a/usr/src/cmd/svr4pkg/pkginstall/dockspace.c b/usr/src/cmd/svr4pkg/pkginstall/dockspace.c
index e306e0dbef..8d6bf9e0ce 100644
--- a/usr/src/cmd/svr4pkg/pkginstall/dockspace.c
+++ b/usr/src/cmd/svr4pkg/pkginstall/dockspace.c
@@ -20,6 +20,10 @@
*/
/*
+ * Copyright (c) 2017 Peter Tribble.
+ */
+
+/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -105,7 +109,7 @@ dockspace(char *spacefile)
if (fs_tab->bfree < (LIM_BFREE + fs_tab->bused)) {
warn(TYPE_BLCK, fs_tab->name, fs_tab->bused,
- fs_tab->bfree, LIM_BFREE);
+ fs_tab->bfree, LIM_BFREE);
error++;
}
@@ -114,7 +118,7 @@ dockspace(char *spacefile)
continue;
if (fs_tab->ffree < (LIM_FFREE + fs_tab->fused)) {
warn(TYPE_NODE, fs_tab->name, fs_tab->fused,
- fs_tab->ffree, LIM_FFREE);
+ fs_tab->ffree, LIM_FFREE);
error++;
}
}
@@ -193,7 +197,7 @@ readmap(int *error)
struct stat statbuf;
char tpath[PATH_MAX];
fsblkcnt_t blk;
- int i, n;
+ int i;
/*
* Handle the installation files (ftype i) that are in the
diff --git a/usr/src/cmd/svr4pkg/pkgremove/check.c b/usr/src/cmd/svr4pkg/pkgremove/check.c
index a013c4cf02..6cf5b4350b 100644
--- a/usr/src/cmd/svr4pkg/pkgremove/check.c
+++ b/usr/src/cmd/svr4pkg/pkgremove/check.c
@@ -20,6 +20,10 @@
*/
/*
+ * Copyright (c) 2017 Peter Tribble.
+ */
+
+/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -153,7 +157,6 @@ rckdepend(void)
{
int n;
char ans[MAX_INPUT];
- char **id, **name;
if (ADM(rdepend, "nocheck")) {
return (0);
diff --git a/usr/src/cmd/svr4pkg/pkgtrans/main.c b/usr/src/cmd/svr4pkg/pkgtrans/main.c
index 79218e06dd..b13920c2a1 100644
--- a/usr/src/cmd/svr4pkg/pkgtrans/main.c
+++ b/usr/src/cmd/svr4pkg/pkgtrans/main.c
@@ -59,10 +59,8 @@ main(int argc, char *argv[])
{
int c;
void (*func)();
- extern char *optarg;
extern int optind;
- char *homedir = NULL;
- int ret, len;
+ int ret;
(void) setlocale(LC_ALL, "");