err() is documented as allowing NULL for the format string but GCC isn't
happy about it any more so change the usage to make buildworld work again.
This commit is contained in:
parent
3951e2ab28
commit
5ad9e45f96
@ -267,7 +267,7 @@ copy(char *argv[], enum op type, int fts_options)
|
||||
umask(~mask);
|
||||
|
||||
if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "fts_open");
|
||||
for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; badcp = 0) {
|
||||
switch (curr->fts_info) {
|
||||
case FTS_NS:
|
||||
|
@ -141,7 +141,7 @@ get_lattr(FTSENT *ent)
|
||||
} else
|
||||
strncpy(ioctl_args.path, ent->fts_accpath, MAXPATHLEN - 1);
|
||||
if (ioctl(devlomac, LIOGETFLATTR, &ioctl_args) == -1)
|
||||
err(1, NULL);
|
||||
err(1, "ioctl");
|
||||
|
||||
/* we use ioctl_args.path as scratch space to build lattr */
|
||||
if (ioctl_args.flags != 0)
|
||||
@ -150,6 +150,6 @@ get_lattr(FTSENT *ent)
|
||||
asprintf(&lattr, "%d", ioctl_args.level);
|
||||
|
||||
if (lattr == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "lattr");
|
||||
return (lattr);
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ traverse(int argc, char *argv[], int options)
|
||||
|
||||
if ((ftsp =
|
||||
fts_open(argv, options, f_nosort ? NULL : mastercmp)) == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "fts_open");
|
||||
|
||||
display(NULL, fts_children(ftsp, 0));
|
||||
if (f_listdir)
|
||||
@ -539,7 +539,7 @@ display(FTSENT *p, FTSENT *list)
|
||||
/* Fill-in "::" as "0:0:0" for the sake of scanf. */
|
||||
jinitmax = initmax2 = malloc(strlen(initmax) * 2 + 2);
|
||||
if (jinitmax == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "malloc");
|
||||
if (*initmax == ':')
|
||||
strcpy(initmax2, "0:"), initmax2 += 2;
|
||||
else
|
||||
@ -675,7 +675,7 @@ display(FTSENT *p, FTSENT *list)
|
||||
flags = strdup("-");
|
||||
}
|
||||
if (flags == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "fflagstostr");
|
||||
flen = strlen(flags);
|
||||
if (flen > (size_t)maxflags)
|
||||
maxflags = flen;
|
||||
@ -692,7 +692,7 @@ display(FTSENT *p, FTSENT *list)
|
||||
|
||||
if ((np = malloc(sizeof(NAMES) + lattrlen +
|
||||
ulen + glen + flen + 4)) == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "malloc");
|
||||
|
||||
np->user = &np->data[0];
|
||||
(void)strcpy(np->user, user);
|
||||
|
@ -113,6 +113,6 @@ get_lattr(int pid)
|
||||
if (devlomac == -1)
|
||||
lomac_start();
|
||||
if (ioctl(devlomac, LIOGETPLEVEL, &pid) == -1)
|
||||
err(1, NULL);
|
||||
err(1, "ioctl");
|
||||
return (pid);
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ toremote(char *targ, int argc, char *argv[])
|
||||
strlen(src) + (tuser ? strlen(tuser) : 0) +
|
||||
strlen(thost) + strlen(targ) + CMDNEEDS + 20;
|
||||
if (!(bp = malloc(len)))
|
||||
err(1, NULL);
|
||||
err(1, "malloc");
|
||||
if (host) {
|
||||
*host++ = 0;
|
||||
suser = argv[i];
|
||||
@ -334,7 +334,7 @@ toremote(char *targ, int argc, char *argv[])
|
||||
if (rem == -1) {
|
||||
len = strlen(targ) + CMDNEEDS + 20;
|
||||
if (!(bp = malloc(len)))
|
||||
err(1, NULL);
|
||||
err(1, "malloc");
|
||||
(void)snprintf(bp, len, "%s -t %s", cmd, targ);
|
||||
host = thost;
|
||||
#ifdef KERBEROS
|
||||
@ -374,7 +374,7 @@ tolocal(int argc, char *argv[])
|
||||
len = strlen(_PATH_CP) + strlen(argv[i]) +
|
||||
strlen(argv[argc - 1]) + 20;
|
||||
if (!(bp = malloc(len)))
|
||||
err(1, NULL);
|
||||
err(1, "malloc");
|
||||
(void)snprintf(bp, len, "exec %s%s%s %s %s", _PATH_CP,
|
||||
iamrecursive ? " -PR" : "", pflag ? " -p" : "",
|
||||
argv[i], argv[argc - 1]);
|
||||
@ -401,7 +401,7 @@ tolocal(int argc, char *argv[])
|
||||
}
|
||||
len = strlen(src) + CMDNEEDS + 20;
|
||||
if ((bp = malloc(len)) == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "malloc");
|
||||
(void)snprintf(bp, len, "%s -f %s", cmd, src);
|
||||
rem =
|
||||
#ifdef KERBEROS
|
||||
|
@ -185,7 +185,7 @@ rm_tree(char **argv)
|
||||
if (Wflag)
|
||||
flags |= FTS_WHITEOUT;
|
||||
if (!(fts = fts_open(argv, flags, NULL)))
|
||||
err(1, NULL);
|
||||
err(1, "fts_open");
|
||||
while ((p = fts_read(fts)) != NULL) {
|
||||
switch (p->fts_info) {
|
||||
case FTS_DNR:
|
||||
@ -436,7 +436,7 @@ check(char *path, char *name, struct stat *sp)
|
||||
return (1);
|
||||
strmode(sp->st_mode, modep);
|
||||
if ((flagsp = fflagstostr(sp->st_flags)) == NULL)
|
||||
err(1, NULL);
|
||||
err(1, "fflagstostr");
|
||||
(void)fprintf(stderr, "override %s%s%s/%s %s%sfor %s? ",
|
||||
modep + 1, modep[9] == ' ' ? "" : " ",
|
||||
user_from_uid(sp->st_uid, 0),
|
||||
|
Loading…
x
Reference in New Issue
Block a user