--- ./lib/libadm/common/ckdate.c.orig 2015-04-05 05:49:06.526048123 +0200 +++ ./lib/libadm/common/ckdate.c 2015-04-05 15:16:58.834021712 +0200 @@ -115,22 +115,18 @@ p_eday(char *string, int llim, int ulim) { char *ptr, *copy; - char daynum[3]; int begin = -1; int iday = 0; int idaymax = 2; - daynum[0] = '\0'; if (*string == BLANK) { string++; idaymax--; } copy = string; while (isdigit((unsigned char)*copy) && (iday < idaymax)) { - daynum[iday] = *copy++; iday++; } - daynum[iday] = '\0'; if (iday == 1) { llim = 1; ulim = 9; @@ -395,9 +391,8 @@ fmt++; } /* end of while fmt and valid */ - if ((*fmt == NULL) && ((input != NULL) && *input != 0)) { - if (*input != NULL) - valid = 0; + if ((*fmt == 0) && ((input != NULL) && *input != '\0')) { + valid = 0; } return ((valid == 0)); } --- ./lib/libadm/common/ckitem.c.orig 2015-04-05 05:49:06.606048123 +0200 +++ ./lib/libadm/common/ckitem.c 2015-04-05 15:21:56.722021481 +0200 @@ -40,6 +40,7 @@ #include #include #include +#include #include "libadm.h" static int insert(struct _choice_ *, CKMENU *); --- ./lib/libadm/common/getvol.c.orig 2015-04-05 05:49:06.554048123 +0200 +++ ./lib/libadm/common/getvol.c 2015-04-05 15:27:14.074021235 +0200 @@ -32,6 +32,7 @@ #include #include +#include #include #include #include "libadm.h" --- ./lib/libadm/common/listdgrp.c.orig 2015-04-05 15:36:18.298020813 +0200 +++ ./lib/libadm/common/listdgrp.c 2015-04-05 15:46:18.230020348 +0200 @@ -112,6 +112,7 @@ * Get the record for this device group */ + rtnval = NULL; if (dgrpent = _getdgrprec(dgroup)) { /* Count the number of members in the device group */ @@ -151,7 +152,6 @@ /* Some error occurred. Clean up allocations */ for (pp = listbuf; *pp; pp++) free(*pp); free(listbuf); - rtnval = NULL; } } /* if (malloc()) */ @@ -160,7 +160,6 @@ _freedgrptabent(dgrpent); } /* if (_getdgrprec()) */ - else rtnval = NULL; /* Finished -- wasn't that simple? */ --- ./lib/libadm/common/pkgparam.c.orig 2015-04-05 15:36:18.302020813 +0200 +++ ./lib/libadm/common/pkgparam.c 2015-04-05 15:48:27.490020248 +0200 @@ -368,8 +368,8 @@ } if (pt = fpkgparam(fp, param)) { - if (strcmp(param, "ARCH") == NULL || - strcmp(param, "CATEGORY") == NULL) { + if (strcmp(param, "ARCH") == 0 || + strcmp(param, "CATEGORY") == 0) { /* remove all whitespace from value */ value = copy = pt; while (*value) { @@ -411,7 +411,7 @@ char * get_PKGLOC(void) { - if (Adm_pkgloc[0] == NULL) + if (Adm_pkgloc[0] == '\0') return (PKGLOC); else return (Adm_pkgloc); @@ -420,7 +420,7 @@ char * get_PKGADM(void) { - if (Adm_pkgadm[0] == NULL) + if (Adm_pkgadm[0] == '\0') return (PKGADM); else return (Adm_pkgadm); --- ./lib/libadm/common/putprmpt.c.orig 2015-04-05 15:36:18.306020813 +0200 +++ ./lib/libadm/common/putprmpt.c 2015-04-05 16:16:53.946018925 +0200 @@ -32,6 +32,7 @@ #include #include +#include #include #include "libadm.h" --- ./lib/libadm/common/puttext.c.orig 2015-04-05 15:36:18.346020813 +0200 +++ ./lib/libadm/common/puttext.c 2015-04-05 16:21:29.662018712 +0200 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include --- ./lib/libpkg/common/devtype.c.orig 2015-04-05 16:25:37.262018520 +0200 +++ ./lib/libpkg/common/devtype.c 2015-04-05 16:54:34.750017173 +0200 @@ -59,7 +59,7 @@ /* see if alias represents a mountable device (e.g., a floppy) */ if ((devp->mount = devattr(alias, "mountpt")) != NULL && - devp->mount[0] != NULL) { + devp->mount[0] != '\0' ) { devp->bdevice = devattr(alias, "bdevice"); if (!devp->bdevice || !devp->bdevice[0]) { if (devp->bdevice) { --- ./lib/libpkg/common/ckvolseq.c.orig 2015-04-05 16:25:37.258018520 +0200 +++ ./lib/libpkg/common/ckvolseq.c 2015-04-05 16:56:00.990017106 +0200 @@ -95,8 +95,7 @@ if (access(path, 0) == 0) return (0); if (part == 1) { - (void) snprintf(path, sizeof (path), "%s/install", - dir, part); + (void) snprintf(path, sizeof (path), "%s/install", dir); if (access(path, 0) == 0) return (0); } --- ./lib/libpkg/common/pkglib.h.orig 2015-04-05 16:25:37.410018520 +0200 +++ ./lib/libpkg/common/pkglib.h 2015-04-06 01:50:24.713992253 +0200 @@ -345,6 +345,9 @@ */ #define NOMODE (BADMODE-1) #define NOOWNER "@" +#ifdef NOGROUP +#undef NOGROUP +#endif #define NOGROUP "@" /* string comparitor abbreviators */ --- ./lib/libpkg/common/dstream.c.orig.04 2015-04-06 02:00:28.861991784 +0200 +++ ./lib/libpkg/common/dstream.c 2015-04-06 02:08:17.513991421 +0200 @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -258,7 +259,7 @@ void ds_putinfo(char *buf, size_t sz) { - (void) snprintf(buf, sz, "%d %d %d %d %d %d %d %d %d %d %s", + (void) snprintf(buf, sz, "%d %d %d %d %d %d %d %d %d %ld %s", ds_fd, ds_realfd, ds_volcnt, ds_volno, ds_totread, ds_volpart, ds_skippart, ds_bufsize, ds_toc->nparts, ds_toc->maxsiz, ds_toc->volnos); @@ -268,7 +269,7 @@ ds_getinfo(char *string) { ds_toc = (struct dstoc *)calloc(1, sizeof (struct dstoc)); - (void) sscanf(string, "%d %d %d %d %d %d %d %d %d %d %[ 0-9]", + (void) sscanf(string, "%d %d %d %d %d %d %d %d %d %ld %[ 0-9]", &ds_fd, &ds_realfd, &ds_volcnt, &ds_volno, &ds_totread, &ds_volpart, &ds_skippart, &ds_bufsize, &ds_toc->nparts, &ds_toc->maxsiz, ds_toc->volnos); @@ -448,7 +449,7 @@ return (-1); } /* LINTED E_SEC_SCANF_UNBOUNDED_COPY */ - if (sscanf(line, "%s %d %d %[ 0-9]", toc_pt->pkg, + if (sscanf(line, "%s %d %ld %[ 0-9]", toc_pt->pkg, &toc_pt->nparts, &toc_pt->maxsiz, toc_pt->volnos) < 3) { progerr(pkg_gt(ERR_UNPACK)); logerr(pkg_gt(MSG_TOC)); @@ -622,7 +623,7 @@ (void) sprintf(prompt, pkg_gt("Insert %%v %d of %d into %%p"), ds_volno, ds_volcnt); - if (n = getvol(device, NULL, NULL, prompt)) + if (n = getvol(device, NULL, 0, prompt)) return (n); if ((ds_fd = open(device, O_RDONLY)) < 0) return (-1); --- ./lib/libpkg/common/gpkgmap.c.orig 2015-04-06 02:00:28.869991784 +0200 +++ ./lib/libpkg/common/gpkgmap.c 2015-04-06 02:12:18.869991234 +0200 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -389,7 +390,6 @@ return (-1); } -done: return (1); } @@ -930,7 +930,6 @@ return (-1); } -done: return (1); } --- ./lib/libpkg/common/mappath.c.orig 2015-04-06 02:00:28.881991784 +0200 +++ ./lib/libpkg/common/mappath.c 2015-04-06 02:14:47.477991119 +0200 @@ -93,7 +93,7 @@ * error. */ if ((token = getenv(varname)) != NULL && - *token != NULL) { + *token != '\0') { /* copy in parameter value */ while (*token) *copy++ = *token++; --- ./lib/libpkg/common/ncgrpw.c.orig 2015-04-06 02:00:29.033991784 +0200 +++ ./lib/libpkg/common/ncgrpw.c 2015-04-06 02:30:31.885990387 +0200 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +52,7 @@ #define ERR_NOGRP "dup_gr_ent(): no group entry provided.\n" #define ERR_NOPWD "dup_pw_ent(): no passwd entry provided.\n" #define ERR_NOINIT "%s: init_cache() failed.\n" -#define ERR_MALLOC "%s: malloc(%d) failed for %s.\n" +#define ERR_MALLOC "%s: malloc(%ld) failed for %s.\n" static Cache *pwnam_cache = (Cache *) NULL; static Cache *grnam_cache = (Cache *) NULL; @@ -90,7 +91,7 @@ pkg_gt(ERR_MALLOC), fname, sizeof (*itemp), "itemp"); } else if ((itemp->key = (char *)malloc(len)) == NULL) { - (void) fprintf(stderr, pkg_gt(ERR_MALLOC), fname, len, + (void) fprintf(stderr, pkg_gt(ERR_MALLOC), fname, (long) len, "itemp->key"); free(itemp); } else if ((itemp->data = malloc(struct_size)) == NULL) { --- ./lib/libpkg/common/pkgtrans.c.orig 2015-04-06 02:00:29.037991784 +0200 +++ ./lib/libpkg/common/pkgtrans.c 2015-04-06 03:01:54.329988928 +0200 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -338,7 +339,7 @@ /* check for datastream */ ids_name = NULL; if (srcdev.bdevice) { - if (n = _getvol(srcdev.bdevice, NULL, NULL, + if (n = _getvol(srcdev.bdevice, NULL, 0, pkg_gt("Insert %v into %p."), srcdev.norewind)) { cleanup(); if (n == 3) @@ -450,7 +451,7 @@ if (ids_name) { if (srcdev.cdevice && !srcdev.bdevice && - (n = _getvol(srcdev.cdevice, NULL, NULL, NULL, + (n = _getvol(srcdev.cdevice, NULL, 0, NULL, srcdev.norewind))) { cleanup(); if (n == 3) @@ -459,8 +460,11 @@ logerr(pkg_gt(MSG_GETVOL)); return (1); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" if (srcdev.dirname = tmpnam(NULL)) tmpdir = srcdev.dirname = strdup(srcdev.dirname); +#pragma GCC diagnostic pop if ((srcdev.dirname == NULL) || mkdir(srcdev.dirname, 0755) || chdir(srcdev.dirname)) { @@ -771,7 +775,7 @@ genheader(char *src, char **pkg) { - FILE *fp; + FILE *fp = NULL; char path[MAXPATHLEN], tmp_entry[ENTRY_MAX]; int i, n, nparts, maxpsize; int partcnt; --- ./lib/libpkg/common/ppkgmap.c.orig 2015-04-06 02:00:28.921991784 +0200 +++ ./lib/libpkg/common/ppkgmap.c 2015-04-06 03:15:04.417988315 +0200 @@ -69,14 +69,14 @@ if (fprintf(fp, " ?") < 0) return (-1); } else { - if (fprintf(fp, " %ld", ept->ainfo.major) < 0) + if (fprintf(fp, " %d", ept->ainfo.major) < 0) return (-1); } if (ept->ainfo.minor == BADMINOR) { if (fprintf(fp, " ?") < 0) return (-1); } else { - if (fprintf(fp, " %ld", ept->ainfo.minor) < 0) + if (fprintf(fp, " %d", ept->ainfo.minor) < 0) return (-1); } } @@ -96,7 +96,7 @@ } if (strchr("ifve", ept->ftype)) { - if (fprintf(fp, ((ept->cinfo.size == BADCONT) ? " ?" : " %llu"), + if (fprintf(fp, ((ept->cinfo.size == BADCONT) ? " ?" : " %lu"), ept->cinfo.size) < 0) return (-1); if (fprintf(fp, ((ept->cinfo.cksum == BADCONT) ? " ?" : " %ld"), --- ./lib/libpkg/common/putcfile.c.orig 2015-04-06 02:00:28.921991784 +0200 +++ ./lib/libpkg/common/putcfile.c 2015-04-06 03:19:07.145988127 +0200 @@ -31,6 +31,7 @@ #include #include +#include #include #include #include "pkgstrct.h" @@ -103,7 +104,7 @@ return (-1); } } else { - if (fprintf(a_fp, " %ld", a_ept->ainfo.major) < 0) + if (fprintf(a_fp, " %d", a_ept->ainfo.major) < 0) return (-1); } @@ -116,7 +117,7 @@ return (-1); } } else { - if (fprintf(a_fp, " %ld", a_ept->ainfo.minor) < 0) + if (fprintf(a_fp, " %d", a_ept->ainfo.minor) < 0) return (-1); } } @@ -150,7 +151,7 @@ if ((a_ept->ftype == 'f') || (a_ept->ftype == 'v') || (a_ept->ftype == 'e')) { if (fprintf(a_fp, - ((a_ept->cinfo.size == BADCONT) ? " ?" : " %llu"), + ((a_ept->cinfo.size == BADCONT) ? " ?" : " %lu"), a_ept->cinfo.size) < 0) return (-1); @@ -335,7 +336,7 @@ (a_ept->ftype == 'e')) { /* size */ vfpPutFormat(a_vfp, - ((a_ept->cinfo.size == BADCONT) ? " ?" : " %llu"), + ((a_ept->cinfo.size == BADCONT) ? " ?" : " %lu"), a_ept->cinfo.size); /* cksum */ --- ./lib/libpkg/common/runcmd.c.orig 2015-04-06 02:00:28.925991784 +0200 +++ ./lib/libpkg/common/runcmd.c 2015-04-06 03:22:29.861987970 +0200 @@ -32,7 +32,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -88,7 +89,7 @@ { if (errfile[0]) { (void) unlink(errfile); - errfile[0] = NULL; + errfile[0] = '\0'; } } --- ./lib/libpkg/common/srchcfile.c.orig 2015-04-06 02:00:28.929991784 +0200 +++ ./lib/libpkg/common/srchcfile.c 2015-04-06 03:31:45.285987539 +0200 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include --- ./lib/libpkg/common/tputcfent.c.orig 2015-04-06 02:00:28.929991784 +0200 +++ ./lib/libpkg/common/tputcfent.c 2015-04-06 03:38:25.665987229 +0200 @@ -95,14 +95,14 @@ (void) fprintf(fp, pkg_gt("Major device number: %s\n"), MSG_INVALID); else - (void) fprintf(fp, pkg_gt("Major device number: %ld\n"), + (void) fprintf(fp, pkg_gt("Major device number: %d\n"), ept->ainfo.major); if (ept->ainfo.minor == BADMINOR) (void) fprintf(fp, pkg_gt("Minor device number: %s\n"), MSG_INVALID); else - (void) fprintf(fp, pkg_gt("Minor device number: %ld\n"), + (void) fprintf(fp, pkg_gt("Minor device number: %d\n"), ept->ainfo.minor); break; @@ -131,7 +131,7 @@ (void) fprintf(fp, pkg_gt("Expected mode: %s\n"), "?"); else - (void) fprintf(fp, pkg_gt("Expected mode: %04lo\n"), + (void) fprintf(fp, pkg_gt("Expected mode: %04o\n"), ept->ainfo.mode); (void) fprintf(fp, pkg_gt("Expected owner: %s\n"), @@ -141,7 +141,7 @@ } if (strchr("?infv", ept->ftype)) { (void) fprintf(fp, - pkg_gt("Expected file size (bytes): %llu\n"), + pkg_gt("Expected file size (bytes): %lu\n"), ept->cinfo.size); (void) fprintf(fp, pkg_gt("Expected sum(1) of contents: %ld\n"), --- ./lib/libpkg/common/verify.c.orig 2015-04-06 02:00:29.033991784 +0200 +++ ./lib/libpkg/common/verify.c 2015-04-06 03:50:16.185986678 +0200 @@ -388,7 +388,7 @@ struct passwd *pwd; int n; int setval; - int uid, gid; + int uid = 0, gid = 0; int dochown; int retcode; int statError = 0; @@ -435,7 +435,7 @@ if (strcmp(cd, c) == 0) (void) strcpy(cd, "/"); else - *c = NULL; + *c = '\0'; if (chdir(cd) != 0) { reperr(pkg_gt(ERR_CHDIR), cd); @@ -679,7 +679,7 @@ return (VE_FAIL); } } else if (*ftype == 'p') { - if (mknod(path, ainfo->mode | S_IFIFO, NULL) || + if (mknod(path, ainfo->mode | S_IFIFO, (dev_t) NULL) || (stat(path, &status) < 0)) { reperr(pkg_gt(ERR_PIPEFAIL)); return (VE_FAIL); --- ./lib/libpkg/common/keystore.c.orig 2015-04-06 02:00:29.037991784 +0200 +++ ./lib/libpkg/common/keystore.c 2015-04-06 03:55:06.849986453 +0200 @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -247,8 +248,8 @@ int ret = 0; char *cn_str, *icn_str, *typ_str; char *tmp; - char *md5_fp; - char *sha1_fp; + char *md5_fp = NULL; + char *sha1_fp = NULL; int len; /* need to localize the word "Fingerprint", hence these pointers */ @@ -1324,7 +1325,7 @@ char storepath[PATH_MAX]; struct stat buf; boolean_t multi = B_FALSE; - int fd1, fd2, len; + int fd1 = -1, fd2 = -1, len; /* * figure out whether we are dealing with a single-file keystore @@ -2261,7 +2262,7 @@ { int fd; struct stat buf; - FILE *newfile; + FILE *newfile = NULL; PKCS12 *p12 = NULL; if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) { --- ./lib/libpkg/common/pkgweb.c.orig 2015-04-06 02:00:29.009991784 +0200 +++ ./lib/libpkg/common/pkgweb.c 2015-04-06 04:09:24.529985788 +0200 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -1090,9 +1091,10 @@ case OCSPInternal: /* Some internal error */ case OCSPVerify: /* OCSP responder indicated fail */ return (0); - } + default: /* all other cases are success, or soft failures */ pkgerr_clear(err); + } } return (ok); @@ -1220,7 +1222,7 @@ subjname = get_subject_display_name(cert); /* parse the URI into its constituent parts */ - if (OCSP_parse_url(uri, &host, &portstr, &path, &use_ssl) == NULL) { + if (OCSP_parse_url(uri, &host, &portstr, &path, &use_ssl) == 0) { pkgerr_add(err, PKGERR_PARSE, gettext(ERR_OCSP_PARSE), uri); return (OCSPParse); } @@ -1368,7 +1370,7 @@ } /* find end of response code */ - for (q = p; (*q != NULL) && !isspace(*q); q++) + for (q = p; (*q != '\0') && !isspace(*q); q++) continue; /* mark end of response code */ @@ -1383,7 +1385,7 @@ } /* now find beginning of the response string */ - while ((*q != NULL) && isspace(*q)) { + while ((*q != '\0') && isspace(*q)) { q++; } @@ -1420,7 +1422,7 @@ p++; /* find beginning of the content type */ - while ((*p != NULL) && isspace(*p)) { + while ((*p != '\0') && isspace(*p)) { p++; } @@ -1495,7 +1497,7 @@ } if (OCSP_basic_verify(bs, cas, NULL, OCSP_TRUSTOTHER) <= 0) { - while ((errcode = ERR_get_error()) != NULL) { + while ((errcode = ERR_get_error()) != 0) { err_reason = ERR_reason_error_string(errcode); if (err_reason == NULL) { err_reason = @@ -1510,7 +1512,7 @@ /* check the validity of our certificate */ if (OCSP_resp_find_status(bs, id, &status, &reason, - &rev, &thisupd, &nextupd) == NULL) { + &rev, &thisupd, &nextupd) == 0) { pkgerr_add(err, PKGERR_PARSE, gettext(ERR_OCSP_VERIFY_NO_STATUS), subjname); return (OCSPVerify); --- ./lib/libpkg/common/security.c.orig 2015-04-06 04:25:45.893985028 +0200 +++ ./lib/libpkg/common/security.c 2015-04-06 04:35:27.989984576 +0200 @@ -34,6 +34,7 @@ #include #include +#include #include #include #include --- ./lib/libpkg/common/parseURL.c.orig 2015-04-06 04:25:45.977985028 +0200 +++ ./lib/libpkg/common/parseURL.c 2015-04-06 04:37:42.545984472 +0200 @@ -27,6 +27,7 @@ #include #include +#include #include #include --- ./cmd/svr4pkg/libinst/scriptvfy.l.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/libinst/scriptvfy.l 2015-04-06 04:50:12.857983890 +0200 @@ -584,6 +584,10 @@ #include #include #include +#include +#include + +extern void logerr(char *fmt, ...); #ifdef DEBUG /* @@ -626,7 +630,7 @@ int error = 0; line_no = 1; - if ((script_path == NULL) || (*script_path == NULL) || + if ((script_path == NULL) || (*script_path == '\0') || (script_name == NULL)) { logerr(gettext(ERR_ARGS)); return (0); --- ./cmd/svr4pkg/libinst/copyf.c.orig 2015-04-06 14:14:38.461957640 +0200 +++ ./cmd/svr4pkg/libinst/copyf.c 2015-04-07 06:44:02.853911625 +0200 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include --- ./cmd/svr4pkg/libinst/fixpath.c.orig 2015-04-06 14:14:38.433957640 +0200 +++ ./cmd/svr4pkg/libinst/fixpath.c 2015-04-07 06:46:43.585911501 +0200 @@ -33,6 +33,7 @@ #include #include +#include #include #include #include /* mkdir() declaration */ @@ -314,7 +315,7 @@ */ else if (strncmp(path, install_root, install_root_len) == 0) { retv = path + install_root_len; - if (*retv == NULL) + if (*retv == '\0') retv = "/"; /* --- ./cmd/svr4pkg/libinst/isreloc.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/libinst/isreloc.c 2015-04-07 06:48:22.705911424 +0200 @@ -137,7 +137,7 @@ register int entry_pos = 1; /* If the line is a comment or special directive, return 0 */ - if (*entry == NULL || strchr(IGNORE_START, *entry)) + if (*entry == '\0' || strchr(IGNORE_START, *entry)) return (0); /* Skip past this data entry if it is volume number. */ @@ -158,7 +158,7 @@ * or the type indicates this line should be ignored, we return * as though not relative. */ - if (*entry == NULL || strchr(IGNORE_TYPE, *entry)) + if (*entry == '\0' || strchr(IGNORE_TYPE, *entry)) return (0); /* The pathname is in the third position */ @@ -172,7 +172,7 @@ while (*entry && isspace(*entry)) { entry++; } - } while (++entry_pos < 3 && *entry != NULL); + } while (++entry_pos < 3 && *entry != '\0'); /* * Now we're pointing at the first character of the pathname. --- ./cmd/svr4pkg/libinst/mntinfo.c.orig 2015-04-06 14:14:38.457957640 +0200 +++ ./cmd/svr4pkg/libinst/mntinfo.c 2015-04-07 07:02:37.009910762 +0200 @@ -34,8 +34,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -243,7 +245,7 @@ if (n >= 0 && n < fs_tab_used) { (void) strcpy(hostname, fs_tab[n]->remote_name); if ((host_end = strchr(hostname, ':')) == NULL) { - if ((strcmp(fs_tab[n]->fstype, MNTTYPE_AUTO)) == NULL) + if ((strcmp(fs_tab[n]->fstype, MNTTYPE_AUTO)) == 0) return ("automounter"); else return (fs_tab[n]->fstype); @@ -1136,7 +1138,7 @@ * do the string compare. -- JST */ if ((fs_namelen == 1 && *(fs_tab[i]->name) == '/') || - ((term_char == '/' || term_char == NULL) && + ((term_char == '/' || term_char == '\0') && strncmp(fs_tab[i]->name, path2use, fs_namelen) == 0)) return (i); } --- ./cmd/svr4pkg/libinst/ocfile.c.orig 2015-04-06 14:14:38.081957641 +0200 +++ ./cmd/svr4pkg/libinst/ocfile.c 2015-04-07 07:06:39.065910574 +0200 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -688,7 +688,7 @@ */ static int pkgWlock(int verbose) { - int retry_cnt, retval; + int retry_cnt, retval = 0; char lockpath[PATH_MAX]; active_lock = 0; --- ./cmd/svr4pkg/libinst/pathdup.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/libinst/pathdup.c 2015-04-07 07:22:15.021909849 +0200 @@ -46,7 +46,8 @@ * memory fragmentation to 12.5% */ #define MEMSIZ PATH_MAX*8 -#define NULL 0 + +extern void quit(int) ; struct dup { char mem[MEMSIZ]; --- ./cmd/svr4pkg/libinst/pkgdbmerg.c.orig 2015-04-06 14:14:38.429957640 +0200 +++ ./cmd/svr4pkg/libinst/pkgdbmerg.c 2015-04-07 14:37:24.917889610 +0200 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -1031,7 +1032,7 @@ * already done. */ if (strcmp(cf_ent->ainfo.local, - el_ent->cf_ent.ainfo.local) != NULL) { + el_ent->cf_ent.ainfo.local) != 0) { changed++; /* @@ -1040,7 +1041,7 @@ * entry. */ if (strcmp(el_ent->cf_ent.ainfo.local, - "?") == NULL) { + "?") == 0) { (void) strlcpy( el_ent->cf_ent.ainfo.local, cf_ent->ainfo.local, --- ./cmd/svr4pkg/libinst/pkgobjmap.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/libinst/pkgobjmap.c 2015-04-07 14:40:19.777889474 +0200 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -227,7 +228,7 @@ if (ext_ptr == NULL || *ext_ptr == NULL) { progerr(gettext(ERR_MEMORY)); - return (NULL); + return (0); } ext = *ext_ptr; --- ./cmd/svr4pkg/libinst/pkgops.c.orig 2015-04-06 14:14:38.429957640 +0200 +++ ./cmd/svr4pkg/libinst/pkgops.c 2015-04-07 14:47:05.029889160 +0200 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include --- ./cmd/svr4pkg/installf/main.c.orig 2015-04-06 14:14:38.429957640 +0200 +++ ./cmd/svr4pkg/installf/main.c 2015-04-07 14:48:26.073889098 +0200 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -508,7 +509,10 @@ quit(warnflag ? 1 : 0); /* LINTED: no return */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type" } +#pragma GCC diagnostic pop void quit(int n) --- ./cmd/svr4pkg/pkgadd/main.c.orig 2015-04-06 14:14:38.449957640 +0200 +++ ./cmd/svr4pkg/pkgadd/main.c 2015-04-07 15:06:43.329888247 +0200 @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -1219,8 +1219,6 @@ keystore_file, ids_name, &repeat); if (b == B_FALSE) { - char path[PATH_MAX]; - echoDebug(DBG_CANNOT_GET_PKGLIST); progerr(ERR_NOPKGS, pkgdev.dirname); @@ -1338,7 +1336,6 @@ pkgInstall(char *a_altRoot, char *a_idsName, char *a_pkgDir, char *a_altBinDir) { char *arg[MAXARGS]; - char *p; char path[PATH_MAX]; char buffer[256]; int n, nargs; @@ -2384,6 +2353,8 @@ char *a_idsName, int a_repeat, char *a_altBinDir, char *a_device, boolean_t a_noZones) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" boolean_t b; /* entry assertions */ @@ -2400,6 +2381,7 @@ b = add_packages_in_global_no_zones(a_pkgList, a_uri, a_idsName, a_repeat, a_altBinDir, a_device); +#pragma GCC diagnostic pop return (B_FALSE); } --- ./cmd/svr4pkg/pkgchk/main.c.orig 2015-04-07 15:16:26.393887795 +0200 +++ ./cmd/svr4pkg/pkgchk/main.c 2015-04-07 20:45:38.081872485 +0200 @@ -148,8 +148,8 @@ int c; int n = 0; char *prog, - *Rvalue, - *dvalue; + *Rvalue = NULL, + *dvalue = NULL; int dbcreate = 0; int pathtype; @@ -529,7 +529,10 @@ } quit(errflg ? 1 : 0); /* LINTED: no return */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type" } +#pragma GCC diagnostic pop static void setpathlist(char *file) --- ./cmd/svr4pkg/libinst/setadmin.c.orig 2015-04-07 15:16:26.389887795 +0200 +++ ./cmd/svr4pkg/libinst/setadmin.c 2015-04-07 20:48:25.977872355 +0200 @@ -50,6 +50,8 @@ extern struct admin adm; /* holds info about install admin */ extern int warnflag; /* != 0 non-fatal error occurred 2 */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-braces" static struct { char **memloc; char *tag; @@ -74,6 +76,7 @@ /* MUST BE LAST ENTRY IN LIST */ (char **)NULL, (char *)NULL }; +#pragma GCC diagnostic pop /* * Name: setadminSetting --- ./cmd/svr4pkg/libinst/lockinst.c.orig.04 2015-04-07 21:57:11.117869157 +0200 +++ ./cmd/svr4pkg/libinst/lockinst.c 2015-04-07 22:00:19.409869011 +0200 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -135,7 +136,7 @@ lock_state = ST_OK; } else { /* LINTED format argument contains unbounded string specifier */ - (void) sscanf(lockbuf, "%ld %s %s %s %u", &lock_pid, + (void) sscanf(lockbuf, "%d %s %s %s %u", &lock_pid, lock_name, lock_pkg, lock_place, &lock_state); } } --- ./cmd/svr4pkg/pkgchk/checkmap.c.orig 2015-04-07 22:00:51.677868986 +0200 +++ ./cmd/svr4pkg/pkgchk/checkmap.c 2015-04-08 00:52:46.321860991 +0200 @@ -329,7 +329,7 @@ } } else { for (i = 0; i < pkgcnt; ++i) { - if (selected[i] == NULL) { + if (selected[i] == '\0') { root = get_inst_root(); if (root) (void) snprintf(buf, --- ./cmd/svr4pkg/pkgchk/ckentry.c.orig 2015-04-07 22:00:51.677868986 +0200 +++ ./cmd/svr4pkg/pkgchk/ckentry.c 2015-04-08 00:55:01.173860887 +0200 @@ -224,8 +224,8 @@ errflg = 0; (void) memset((char *)&mine, '\0', sizeof (struct cfent)); while ((drp = readdir(dirfp)) != NULL) { - if (strcmp(drp->d_name, ".") == NULL || - strcmp(drp->d_name, "..") == NULL) + if (strcmp(drp->d_name, ".") == 0 || + strcmp(drp->d_name, "..") == 0) continue; dirfound = 0; while ((n = NXTENTRY(&mine, vfp)) != 0) { @@ -242,7 +242,7 @@ if (strncmp(mine.path, dirname, len) || (mine.path[len] != '/')) break; - if (strcmp(drp->d_name, &mine.path[len+1]) == NULL) { + if (strcmp(drp->d_name, &mine.path[len+1]) == 0) { dirfound++; break; } --- ./cmd/svr4pkg/pkginfo/pkginfo.c.orig 2015-04-07 22:00:51.837868986 +0200 +++ ./cmd/svr4pkg/pkginfo/pkginfo.c 2015-04-08 01:01:19.293860594 +0200 @@ -271,7 +271,7 @@ pkg = &argv[optind]; pkgcnt = (argc - optind); - if (pkg[0] && strcmp(pkg[0], "all") == NULL) { + if (pkg[0] && strcmp(pkg[0], "all") == 0) { pkgcnt = 0; pkg[0] = NULL; } @@ -293,7 +293,7 @@ look_for_installed(); - if (lflag && strcmp(pkgdir, get_PKGLOC()) == NULL) { + if (lflag && strcmp(pkgdir, get_PKGLOC()) == 0) { /* look at contents file */ (void) snprintf(contents, sizeof (contents), "%s/contents", get_PKGADM()); @@ -354,10 +354,10 @@ * Confirm that the pkginfo file contains the * required information. */ - if (info.name == NULL || *(info.name) == NULL || - info.arch == NULL || *(info.arch) == NULL || - info.version == NULL || *(info.version) == NULL || - info.catg == NULL || *(info.catg) == NULL) { + if (info.name == NULL || *(info.name) == '\0' || + info.arch == NULL || *(info.arch) == '\0' || + info.version == NULL || *(info.version) == '\0' || + info.catg == NULL || *(info.catg) == '\0') { progerr(gettext(ERR_BADINFO)); errflg++; return; @@ -540,7 +540,7 @@ dp = data; last = (struct cfstat *)0; while (dp) { - if (strcmp(dp->pkginst, pkginst) == NULL) + if (strcmp(dp->pkginst, pkginst) == 0) return (dp); last = dp; dp = dp->next; @@ -599,7 +599,6 @@ look_for_installed(void) { struct dirent *drp; - struct stat status; DIR *dirfp; char path[PATH_MAX]; --- ./cmd/svr4pkg/pkginstall/quit.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkginstall/quit.c 2015-04-08 01:03:13.933860505 +0200 @@ -289,12 +289,12 @@ ptext(stderr, MSG_DRYRUN_DONE); ptext(stderr, MSG_NOCHANGE); - if (tmpdir[0] != NULL) + if (tmpdir[0] != '\0') (void) rrmdir(tmpdir); } else { /* fix bug #1082589 that deletes root file */ - if (tmpdir[0] != NULL) { + if (tmpdir[0] != '\0') { (void) rrmdir(tmpdir); } --- ./cmd/svr4pkg/pkginstall/dockspace.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkginstall/dockspace.c 2015-04-08 01:04:21.089860453 +0200 @@ -193,7 +193,7 @@ 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 --- ./cmd/svr4pkg/pkginstall/getinst.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkginstall/getinst.c 2015-04-08 01:08:23.381860265 +0200 @@ -110,10 +110,10 @@ samearch = nsamearch = 0; sameinst = NULL; for (i = 0; i < npkgs; i++) { - if (strcmp(info[i].arch, pkgarch) == NULL) { + if (strcmp(info[i].arch, pkgarch) == 0) { samearch = i; nsamearch++; - if (strcmp(info[i].version, pkgvers) == NULL) { + if (strcmp(info[i].version, pkgvers) == 0) { sameinst = info[i].pkginst; } } @@ -189,7 +189,7 @@ } inst = prompt(info, npkgs); - if (strcmp(inst, "new") == NULL) { + if (strcmp(inst, "new") == 0) { inst = nextinst(); return (inst); } --- ./cmd/svr4pkg/pkginstall/merginfo.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkginstall/merginfo.c 2015-04-08 02:10:01.129857399 +0200 @@ -203,12 +203,12 @@ /* entry debugging info */ echoDebug(DBG_MERGINFO_ENTRY, - instdir ? instdir : "??", + instdir, ((get_inst_root()) && (strcmp(get_inst_root(), "/") != 0)) ? get_inst_root() : "??", - saveSpoolInstallDir ? saveSpoolInstallDir : "??", - pkgloc ? pkgloc : "??", is_spool_create(), + saveSpoolInstallDir, + pkgloc, get_info_basedir() ? get_info_basedir() : "??", pkginfoPath, path); --- ./cmd/svr4pkg/pkginstall/reqexec.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkginstall/reqexec.c 2015-04-08 02:54:19.929855338 +0200 @@ -33,6 +33,7 @@ #include #include #include +#include #include /* creat() declaration */ #include #include --- ./cmd/svr4pkg/pkginstall/main.c.orig 2015-04-07 22:00:51.837868986 +0200 +++ ./cmd/svr4pkg/pkginstall/main.c 2015-04-08 03:13:25.377854450 +0200 @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,8 @@ #include #include "pkginstall.h" +extern int cftime(char *, char *, const time_t *); + /* imported globals */ extern char **environ; @@ -2051,8 +2054,8 @@ echoDebug(DBG_PKGINSTALL_INSDONE, is_depend_pkginfo_DB(), is_depend_pkginfo_DB(), saveSpoolInstall, updated ? updated : "", - script ? script : "", - script ? access(script, F_OK) : -1); + script, + access(script, F_OK)); /* update the lock - at the postinstall script */ lockupd("postinstall"); @@ -2113,7 +2116,10 @@ quit(0); /* LINTED: no return */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type" } +#pragma GCC diagnostic pop /* * This function merges the environment data in the response file with the --- ./cmd/svr4pkg/pkgmk/splpkgmap.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkgmk/splpkgmap.c 2015-04-08 03:22:53.597854009 +0200 @@ -541,7 +541,7 @@ if (volno) { (void) fprintf(stderr, - gettext("part %2d -- %llu blocks, %llu entries\n"), + gettext("part %2d -- %lu blocks, %lu entries\n"), volno, btotal, ftotal); if (btotal > bmax) bmax = btotal; --- ./cmd/svr4pkg/pkgmk/main.c.orig 2015-04-07 22:00:51.837868986 +0200 +++ ./cmd/svr4pkg/pkgmk/main.c 2015-04-08 03:26:36.009853837 +0200 @@ -56,6 +56,7 @@ #include #include +extern int cftime(char *, char *, const time_t *); extern char **environ, *pkgdir; /* mkpkgmap.c */ @@ -422,7 +423,7 @@ /* add command line variables */ while (*cmdparam && (value = strchr(*cmdparam, '=')) != NULL) { - *value = NULL; /* terminate the parameter */ + *value = '\0'; /* terminate the parameter */ value++; /* value is now the value (not '=') */ putparam(*cmdparam++, value); /* store it in environ */ } @@ -678,7 +679,10 @@ quit(0); /* LINTED: no return */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type" } +#pragma GCC diagnostic pop static void trap(int n) @@ -712,7 +716,7 @@ progerr(gettext(ERR_TEMP), errno); quit(99); } - (void) fprintf(fp, ": %d %llu\n", nparts, limit); + (void) fprintf(fp, ": %d %lu\n", nparts, limit); for (i = 0; eptlist[i]; i++) { svpt = eptlist[i]->ainfo.local; if (!strchr("sl", eptlist[i]->ftype)) --- ./cmd/svr4pkg/pkgmk/mkpkgmap.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkgmk/mkpkgmap.c 2015-04-08 03:33:52.013853499 +0200 @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -536,9 +537,8 @@ (void) strncpy(group, group_ptr, ATRSIZ); else { error(1); - logerr(gettext(MSG_GARBDEFLT), (attrib_save) ? - ((attrib_save[0]) ? attrib_save : gettext("none")) : - gettext("unreadable at group")); + logerr(gettext(MSG_GARBDEFLT), + (attrib_save[0]) ? attrib_save : gettext("none")); return (1); } @@ -546,9 +546,8 @@ (void) strncpy(owner, owner_ptr, ATRSIZ); else { error(1); - logerr(gettext(MSG_GARBDEFLT), (attrib_save) ? - ((attrib_save[0]) ? attrib_save : gettext("none")) : - gettext("unreadable at owner")); + logerr(gettext(MSG_GARBDEFLT), + (attrib_save[0]) ? attrib_save : gettext("none")); return (1); } @@ -561,9 +560,8 @@ mode = strtol(mode_ptr, &pt, 8); else { error(1); - logerr(gettext(MSG_GARBDEFLT), (attrib_save) ? - ((attrib_save[0]) ? attrib_save : gettext("none")) : - gettext("unreadable at mode")); + logerr(gettext(MSG_GARBDEFLT), + (attrib_save[0]) ? attrib_save : gettext("none")); return (1); } @@ -600,7 +598,7 @@ translate(file, temp); canonize(temp); - if (*temp == NULL) + if (*temp == '\0') return; else if (*temp != '/') (void) snprintf(file, sizeof (file), "%s/%s", dname[nfp], temp); --- ./cmd/svr4pkg/pkgname/pkgname.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkgname/pkgname.c 2015-04-08 03:36:39.573853369 +0200 @@ -30,7 +30,7 @@ #include #include -#include +#include #include int --- ./cmd/svr4pkg/pkgproto/main.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkgproto/main.c 2015-04-08 03:45:54.853852939 +0200 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -82,7 +83,7 @@ static void findlink(struct cfent *ept, char *path, char *svpath); static void follow(char *path); -static void output(char *path, int n, char *local); +static void output(char *path, unsigned int n, char *local); static void usage(void); int @@ -163,7 +164,7 @@ } static void -output(char *path, int n, char *local) +output(char *path, unsigned int n, char *local) { char mypath[PATH_MAX]; int len; @@ -272,13 +273,13 @@ local[PATH_MAX], newpath[PATH_MAX], cmd[PATH_MAX+32]; - int n; + unsigned int n; errflg = 0; if (pt = strchr(path, '=')) { *pt++ = '\0'; - n = ((unsigned int)pt - (unsigned int)path - 1); + n = (unsigned int)(pt - path - 1); if (n >= PATH_MAX) { progerr(gettext(ERR_PATHLONG)); errflg++; --- ./cmd/svr4pkg/pkgremove/main.c.orig 2015-04-07 22:00:51.841868986 +0200 +++ ./cmd/svr4pkg/pkgremove/main.c 2015-04-08 03:50:16.301852736 +0200 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -1057,7 +1058,10 @@ quit(0); /* LINTED: no return */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type" } +#pragma GCC diagnostic pop int issymlink(char *path) --- ./cmd/svr4pkg/pkgremove/special.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkgremove/special.c 2015-04-08 04:02:54.933852148 +0200 @@ -499,7 +499,7 @@ { int result = 0; /* Assume we will succeed. Return result. */ char **ppcSC = NULL; /* The special contents rules, sorted. */ - int i, j; /* Indexes into contents & special contents */ + int i; /* Indexes into contents & special contents */ FILE *fpi = NULL, /* Input of contents file */ *fpo = NULL; /* Output to temp contents file */ char cpath[PATH_MAX], /* Contents file path */ @@ -599,7 +599,7 @@ */ (void) memset(line, 0, LINESZ); - for (i = 0, j = 0; fgets(line, LINESZ, fpi) != NULL; ) { + for (i = 0; fgets(line, LINESZ, fpi) != NULL; ) { char *pcpath = NULL; @@ -615,7 +615,7 @@ pcpath = get_path(line); if (pcpath != NULL && i < ient) { - int k; + int k = 0; while (piIndex[i] == 0) i++; --- ./cmd/svr4pkg/pkgremove/check.c.orig 2015-04-08 04:37:01.413850562 +0200 +++ ./cmd/svr4pkg/pkgremove/check.c 2015-04-08 04:41:13.029850367 +0200 @@ -89,7 +89,7 @@ if ((pt = strtok(pt, " \t\n, ")) == NULL) return (0); /* no list is no list */ do { - if (strcmp(pt, uxstate) == NULL) { + if (strcmp(pt, uxstate) == 0) { free(rstates); return (0); } @@ -146,7 +146,6 @@ { int n; char ans[MAX_INPUT]; - char **id, **name; if (ADM(rdepend, "nocheck")) { return (0); @@ -206,9 +205,9 @@ found = 0; while ((dp = readdir(dirfp)) != NULL) { - if ((strcmp(dp->d_name, "preremove") == NULL) || - (strcmp(dp->d_name, "postremove") == NULL) || - (strncmp(dp->d_name, "r.", 2) == NULL)) { + if ((strcmp(dp->d_name, "preremove") == 0) || + (strcmp(dp->d_name, "postremove") == 0) || + (strncmp(dp->d_name, "r.", 2) == 0)) { found++; break; } --- ./cmd/svr4pkg/pkgrm/main.c.orig 2015-04-08 05:00:30.069849470 +0200 +++ ./cmd/svr4pkg/pkgrm/main.c 2015-04-08 05:13:42.341848856 +0200 @@ -770,7 +770,7 @@ { boolean_t b; char ans[MAX_INPUT]; - int n; + int n = 0; struct pkginfo *pinfo = (struct pkginfo *)NULL; /* NOTE: required 'pkgdir' set to spool directory or NULL */ @@ -1383,6 +1383,8 @@ int a_repeat, char *a_altBinDir, char *a_pkgdir, char *a_spoolDir, boolean_t a_noZones) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" boolean_t b; /* entry assertions */ @@ -1421,6 +1423,7 @@ b = remove_packages_in_global_no_zones(a_pkgList, a_nodelete, a_longestPkg, a_repeat, a_altBinDir); +#pragma GCC diagnostic pop return (B_FALSE); } --- ./cmd/svr4pkg/pkgtrans/main.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkgtrans/main.c 2015-04-08 05:17:44.877848668 +0200 @@ -64,8 +64,8 @@ char *keystore_file = NULL; boolean_t create_sig = B_FALSE; char *homedir = NULL; - PKG_ERR *err; - int ret, len; + PKG_ERR *err = NULL; + int ret; (void) setlocale(LC_ALL, ""); @@ -194,7 +194,10 @@ quit(ret); /*NOTREACHED*/ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type" } +#pragma GCC diagnostic pop void quit(int retcode) --- ./cmd/svr4pkg/pkgadm/addcert.c.orig 2015-04-08 05:00:30.101849470 +0200 +++ ./cmd/svr4pkg/pkgadm/addcert.c 2015-04-08 05:18:54.165848614 +0200 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include --- ./cmd/svr4pkg/pkgadm/listcert.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkgadm/listcert.c 2015-04-08 05:20:03.165848561 +0200 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include --- ./cmd/svr4pkg/pkgadm/lock.c.orig.04 2015-04-08 06:14:39.173846021 +0200 +++ ./cmd/svr4pkg/pkgadm/lock.c 2015-04-08 06:16:23.893845940 +0200 @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include @@ -172,6 +172,7 @@ /* * Forward declarations */ +extern int mkdirp(const char *, mode_t); /* local main function implementation methods */ @@ -1277,7 +1278,7 @@ char s2Prefix[MAXPATHLEN] = {'\0'}; int result = 0; int s1Cnt; - int s2Cnt; + int s2Cnt = 0; /* entry assertions */ @@ -1826,6 +1827,8 @@ static boolean_t _validateLock(int a_fd, LOCK_T *a_theLock, int a_quiet) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" ADMINLOCK_T *pll; char *pld; long pls; @@ -1836,6 +1839,7 @@ pld = &a_theLock->_lrLockData[0]; pll = &a_theLock->_lrLock; pls = sizeof (a_theLock->_lrLockData); +#pragma GCC diagnostic pop /* return true if no process i.d. associated with lock */ @@ -2028,7 +2032,6 @@ static char * _getUniqueId(void) { - char *args[10]; char *execResults; char newkey[LOCK_KEY_MAXLEN]; struct timespec hretime; @@ -2043,9 +2046,6 @@ * 7814e3c1-1dd2-11b2-9fe8-000d560ddc82 */ - args[0] = "makeuuid"; - args[1] = (char *)NULL; - b = e_ExecCmdList(&execStatus, &execResults, (char *)NULL, "/usr/bin/uuid", (char *)NULL); --- ./cmd/svr4pkg/pkgadm/main.c.orig 2015-04-08 06:14:38.841846021 +0200 +++ ./cmd/svr4pkg/pkgadm/main.c 2015-04-08 06:21:40.169845695 +0200 @@ -84,7 +84,7 @@ int main(int argc, char **argv) { - char cur_cmd; + int cur_cmd; int newargc; char **newargv; int i; --- ./cmd/svr4pkg/pkgadm/removecert.c.orig 2013-06-01 03:27:50.000000000 +0200 +++ ./cmd/svr4pkg/pkgadm/removecert.c 2015-04-08 06:23:19.757845618 +0200 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include --- ./cmd/svr4pkg/pkgcond/main.c.orig 2015-04-08 06:14:39.173846021 +0200 +++ ./cmd/svr4pkg/pkgcond/main.c 2015-04-08 06:25:18.085845526 +0200 @@ -75,6 +75,7 @@ #include #include #include +#include #include #include #include @@ -3784,7 +3785,6 @@ parseGlobalData(char *a_envVar, GLOBALDATA_T **r_gdt) { int r; - int n; char *a; SML_TAG *tag; SML_TAG *ntag;