summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/fs.d/autofs/auto_subr.c10
-rw-r--r--usr/src/cmd/fs.d/autofs/autod_main.c4
-rw-r--r--usr/src/cmd/fs.d/dev/mount.c4
-rw-r--r--usr/src/cmd/fs.d/fslib.c12
-rw-r--r--usr/src/cmd/fs.d/mount.c28
-rw-r--r--usr/src/cmd/fs.d/nfs/lib/nfs_resolve.c8
-rw-r--r--usr/src/cmd/fs.d/nfs/lib/ref_subr.c2
-rw-r--r--usr/src/cmd/fs.d/nfs/nfsd/nfsd.c4
-rw-r--r--usr/src/cmd/fs.d/nfs/nfsmapid/nfsmapid.c4
-rw-r--r--usr/src/cmd/fs.d/nfs/nfsstat/nfsstat.c2
-rw-r--r--usr/src/cmd/fs.d/nfs/rquotad/rpc.rquotad.c16
-rw-r--r--usr/src/cmd/fs.d/nfs/statd/sm_proc.c4
-rw-r--r--usr/src/cmd/fs.d/pcfs/fsck/clusters.c4
-rw-r--r--usr/src/cmd/fs.d/smbclnt/fksmbcl/fksmbcl_main.c2
-rw-r--r--usr/src/cmd/fs.d/udfs/fsck/setup.c6
-rw-r--r--usr/src/cmd/fs.d/udfs/fsck/utilities.c6
-rw-r--r--usr/src/cmd/fs.d/udfs/fsdb/Makefile20
-rw-r--r--usr/src/cmd/fs.d/udfs/fsdb/fsdb.c4
-rw-r--r--usr/src/cmd/fs.d/udfs/fstyp/ud_lib.c4
-rw-r--r--usr/src/cmd/fs.d/udfs/labelit/Makefile23
-rw-r--r--usr/src/cmd/fs.d/udfs/mkfs/mkfs.c8
-rw-r--r--usr/src/cmd/fs.d/ufs/df/df.c14
-rw-r--r--usr/src/cmd/fs.d/ufs/edquota/edquota.c6
-rw-r--r--usr/src/cmd/fs.d/ufs/fsck/main.c4
-rw-r--r--usr/src/cmd/fs.d/ufs/fsdb/fsdb.c46
-rw-r--r--usr/src/cmd/fs.d/ufs/mkfs/mkfs.c2
-rw-r--r--usr/src/cmd/fs.d/ufs/quot/quot.c12
-rw-r--r--usr/src/cmd/fs.d/ufs/quota/quota.c8
-rw-r--r--usr/src/cmd/fs.d/ufs/quotacheck/quotacheck.c14
-rw-r--r--usr/src/cmd/fs.d/ufs/quotaon/quotaon.c8
-rw-r--r--usr/src/cmd/fs.d/ufs/repquota/repquota.c6
-rw-r--r--usr/src/cmd/fs.d/ufs/roll_log/roll_log.c38
-rw-r--r--usr/src/cmd/fs.d/ufs/tunefs/tunefs.c8
-rw-r--r--usr/src/cmd/fs.d/ufs/volcopy/volcopy.c42
34 files changed, 169 insertions, 214 deletions
diff --git a/usr/src/cmd/fs.d/autofs/auto_subr.c b/usr/src/cmd/fs.d/autofs/auto_subr.c
index 64cbe46907..200d118ea8 100644
--- a/usr/src/cmd/fs.d/autofs/auto_subr.c
+++ b/usr/src/cmd/fs.d/autofs/auto_subr.c
@@ -657,9 +657,9 @@ macro_expand(key, pline, plineq, size)
* and returns the quoting information in "qbuf". Character is
* considered escaped when it is
*
- * preceded with '\' e.g. \a
- * within quotes e.g. "string"
- * a ':' in brackets e.g. [an:ip:6::ad::d:re:s:s]
+ * preceded with '\' e.g. \a
+ * within quotes e.g. "string"
+ * a ':' in brackets e.g. [an:ip:6::ad::d:re:s:s]
*
* original str: 'the "brown" f\ox said: [fe80::20a:e4ff:fe35:8b0d]'
* unquoted str: 'the brown fox said: [fe80::20a:e4ff:fe35:8b0d]'
@@ -1078,7 +1078,7 @@ put_automountd_env(void)
SCF_TYPE_ASTRING, AUTOMOUNTD, &bufsz);
if (ret == SA_OK) {
a = c = defval;
- if (*a == NULL)
+ if (*a == '\0')
return;
/*
* Environment variables can have more than one value
@@ -1097,7 +1097,7 @@ put_automountd_env(void)
putenv(strdup(a));
a = c = p + 1;
}
- if (*a != NULL) {
+ if (*a != '\0') {
if ((c = strchr(a, '=')) != NULL)
putenv(strdup(a));
}
diff --git a/usr/src/cmd/fs.d/autofs/autod_main.c b/usr/src/cmd/fs.d/autofs/autod_main.c
index 566e4484ec..0c0d4f418d 100644
--- a/usr/src/cmd/fs.d/autofs/autod_main.c
+++ b/usr/src/cmd/fs.d/autofs/autod_main.c
@@ -201,12 +201,12 @@ main(argc, argv)
* mounts and executable automount maps
*/
if ((did_fork_exec = door_create(automountd_do_fork_exec,
- NULL, NULL)) == -1) {
+ NULL, 0)) == -1) {
syslog(LOG_ERR, "door_create failed: %m, Exiting.");
exit(errno);
}
if ((did_exec_map = door_create(automountd_do_exec_map,
- NULL, NULL)) == -1) {
+ NULL, 0)) == -1) {
syslog(LOG_ERR, "door_create failed: %m, Exiting.");
if (door_revoke(did_fork_exec) == -1) {
syslog(LOG_ERR, "failed to door_revoke(%d) %m",
diff --git a/usr/src/cmd/fs.d/dev/mount.c b/usr/src/cmd/fs.d/dev/mount.c
index cc8b7a9cdf..5064d849f7 100644
--- a/usr/src/cmd/fs.d/dev/mount.c
+++ b/usr/src/cmd/fs.d/dev/mount.c
@@ -239,7 +239,7 @@ parse_subopts(char *subopts)
return (-1);
mountargs.sdev_attrdir =
(uint64_t)(uintptr_t)do_strdup(path);
- if (mountargs.sdev_attrdir == NULL)
+ if (mountargs.sdev_attrdir == 0)
return (-1);
}
break;
@@ -343,7 +343,7 @@ main(int argc, char **argv)
/* Special checks if /dev is the mount point */
/* Remount of /dev requires an attribute directory */
if (strcmp(mountpt, "/dev") == 0 && remount &&
- mountargs.sdev_attrdir == NULL) {
+ mountargs.sdev_attrdir == 0) {
(void) fprintf(stderr, gettext("%s: missing attribute "
"directory\n"), typename);
return (1);
diff --git a/usr/src/cmd/fs.d/fslib.c b/usr/src/cmd/fs.d/fslib.c
index 5948c1e43e..6284c2eff5 100644
--- a/usr/src/cmd/fs.d/fslib.c
+++ b/usr/src/cmd/fs.d/fslib.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -165,9 +163,9 @@ fsfreemntlist(mntlist_t *mntl)
mntlist_t *
fsmkmntlist(FILE *mfp)
{
- struct extmnttab mnt;
- mntlist_t *mhead, *mtail;
- int ret;
+ struct extmnttab mnt;
+ mntlist_t *mhead, *mtail;
+ int ret;
mhead = mtail = NULL;
@@ -207,7 +205,7 @@ alloc_failed:
mntlist_t *
fsgetmlast(mntlist_t *ml, struct mnttab *mntin)
{
- mntlist_t *delete = NULL;
+ mntlist_t *delete = NULL;
for (; ml; ml = ml->mntl_next) {
if (mntin->mnt_mountp && mntin->mnt_special) {
@@ -243,7 +241,7 @@ fsgetmlevel(char *cp)
int mlevel;
char *cp1;
- if (cp == NULL || *cp == NULL || *cp != '/')
+ if (cp == NULL || *cp == '\0' || *cp != '/')
return (0); /* this should never happen */
mlevel = 1; /* root (/) is the minimal case */
diff --git a/usr/src/cmd/fs.d/mount.c b/usr/src/cmd/fs.d/mount.c
index 947767f5db..3fdb498f2c 100644
--- a/usr/src/cmd/fs.d/mount.c
+++ b/usr/src/cmd/fs.d/mount.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
@@ -34,9 +34,9 @@
#include <stdio.h>
#include <stdio_ext.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <unistd.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
@@ -71,9 +71,9 @@
#define READONLY 0
#define READWRITE 1
-#define SUID 2
+#define SUID 2
#define NOSUID 3
-#define SETUID 4
+#define SETUID 4
#define NOSETUID 5
#define DEVICES 6
#define NODEVICES 7
@@ -720,7 +720,7 @@ flags(char *mntopts, int flag)
/*
* The assumed assertion
- * assert (strlen(mntflags) < sizeof mntflags);
+ * assert (strlen(mntflags) < sizeof mntflags);
* is valid at this point in the code. Note that a call to "assert"
* is not appropriate in production code since it halts the program.
*/
@@ -871,7 +871,7 @@ ignore(char *opts)
char *saveptr, *my_opts;
int rval = 0;
- if (opts == NULL || *opts == NULL)
+ if (opts == NULL || *opts == '\0')
return (0);
/*
@@ -904,8 +904,8 @@ ignore(char *opts)
int
parmount(char **mntlist, int count, char *fstype)
{
- int maxfd = OPEN_MAX;
- struct rlimit rl;
+ int maxfd = OPEN_MAX;
+ struct rlimit rl;
vfsent_t **vl, *vp;
/*
@@ -1005,7 +1005,7 @@ vfsent_t *
getvfsall(char *fstype, int takeall)
{
vfsent_t *vhead, *vtail;
- struct vfstab vget;
+ struct vfstab vget;
FILE *fp;
int cnt = 0, ret;
@@ -1074,7 +1074,7 @@ getvfsall(char *fstype, int takeall)
vfsent_t **
make_vfsarray(char **mntlist, int count)
{
- vfsent_t *vp, *vmark, *vpprev, **vpp;
+ vfsent_t *vp, *vmark, *vpprev, **vpp;
int ndx, found;
if (vfsll == NULL)
@@ -1185,8 +1185,8 @@ make_vfsarray(char **mntlist, int count)
void
do_mounts(void)
{
- int i, isave, cnt;
- vfsent_t *vp, *vpprev, **vl;
+ int i, isave, cnt;
+ vfsent_t *vp, *vpprev, **vl;
char *newargv[ARGV_MAX];
pid_t child;
diff --git a/usr/src/cmd/fs.d/nfs/lib/nfs_resolve.c b/usr/src/cmd/fs.d/nfs/lib/nfs_resolve.c
index 4951afd001..704b3616cb 100644
--- a/usr/src/cmd/fs.d/nfs/lib/nfs_resolve.c
+++ b/usr/src/cmd/fs.d/nfs/lib/nfs_resolve.c
@@ -299,11 +299,11 @@ setup_nb_parms(struct netconfig *nconf, struct t_bind *tbind,
netdir_free((void *)retaddrs, ND_ADDRLIST);
if (port) {
/* LINTED pointer alignment */
- if (strcmp(nconf->nc_protofmly, NC_INET) == NULL)
+ if (strcmp(nconf->nc_protofmly, NC_INET) == 0)
((struct sockaddr_in *)
tbind->addr.buf)->sin_port =
htons((ushort_t)port);
- else if (strcmp(nconf->nc_protofmly, NC_INET6) == NULL)
+ else if (strcmp(nconf->nc_protofmly, NC_INET6) == 0)
((struct sockaddr_in6 *)
tbind->addr.buf)->sin6_port =
htons((ushort_t)port);
@@ -317,11 +317,11 @@ setup_nb_parms(struct netconfig *nconf, struct t_bind *tbind,
} else if (!file_handle) {
if (port) {
/* LINTED pointer alignment */
- if (strcmp(nconf->nc_protofmly, NC_INET) == NULL)
+ if (strcmp(nconf->nc_protofmly, NC_INET) == 0)
((struct sockaddr_in *)
tbind->addr.buf)->sin_port =
htons((ushort_t)port);
- else if (strcmp(nconf->nc_protofmly, NC_INET6) == NULL)
+ else if (strcmp(nconf->nc_protofmly, NC_INET6) == 0)
((struct sockaddr_in6 *)
tbind->addr.buf)->sin6_port =
htons((ushort_t)port);
diff --git a/usr/src/cmd/fs.d/nfs/lib/ref_subr.c b/usr/src/cmd/fs.d/nfs/lib/ref_subr.c
index b4980593d7..f3afed3ac4 100644
--- a/usr/src/cmd/fs.d/nfs/lib/ref_subr.c
+++ b/usr/src/cmd/fs.d/nfs/lib/ref_subr.c
@@ -191,7 +191,7 @@ nfs4_create_components(char *path, component4 *comp4)
bcopy(path, buf, slen);
buf[slen] = '\0';
if (str_to_utf8(buf, &comp4[ncomp]) == NULL)
- return (NULL);
+ return (0);
}
ncomp++; /* 1 valid component */
diff --git a/usr/src/cmd/fs.d/nfs/nfsd/nfsd.c b/usr/src/cmd/fs.d/nfs/nfsd/nfsd.c
index 5c953fa833..752d143b2b 100644
--- a/usr/src/cmd/fs.d/nfs/nfsd/nfsd.c
+++ b/usr/src/cmd/fs.d/nfs/nfsd/nfsd.c
@@ -23,7 +23,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -848,7 +848,7 @@ dss_init(uint_t npaths, char **pathnames)
/* now NULL out any duplicates */
i = 0; j = 1; nskipped = 0;
while (j < npaths) {
- if (strcmp(pathnames[i], pathnames[j]) == NULL) {
+ if (strcmp(pathnames[i], pathnames[j]) == 0) {
pathnames[j] = NULL;
j++;
nskipped++;
diff --git a/usr/src/cmd/fs.d/nfs/nfsmapid/nfsmapid.c b/usr/src/cmd/fs.d/nfs/nfsmapid/nfsmapid.c
index 46d282d948..d3d8124f37 100644
--- a/usr/src/cmd/fs.d/nfs/nfsmapid/nfsmapid.c
+++ b/usr/src/cmd/fs.d/nfs/nfsmapid/nfsmapid.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdlib.h>
#include <stropts.h>
@@ -173,7 +171,7 @@ thr_init(void)
* signals from main thread so that any subsequent threads
* don't receive said signals.
*/
- (void) thr_sigsetmask(NULL, NULL, &sigset);
+ (void) thr_sigsetmask(0, NULL, &sigset);
(void) sigaddset(&sigset, SIGHUP);
(void) sigaddset(&sigset, SIGTERM);
#ifdef DEBUG
diff --git a/usr/src/cmd/fs.d/nfs/nfsstat/nfsstat.c b/usr/src/cmd/fs.d/nfs/nfsstat/nfsstat.c
index 64381da71e..f0c3f532f4 100644
--- a/usr/src/cmd/fs.d/nfs/nfsstat/nfsstat.c
+++ b/usr/src/cmd/fs.d/nfs/nfsstat/nfsstat.c
@@ -235,7 +235,7 @@ main(int argc, char *argv[])
if ((argc - optind) > 0) {
count = safe_strtoi(argv[optind], "invalid count");
- if ((count <= 0) || (count == NULL))
+ if (count <= 0)
fail(0, "invalid count\n");
}
optind++;
diff --git a/usr/src/cmd/fs.d/nfs/rquotad/rpc.rquotad.c b/usr/src/cmd/fs.d/nfs/rquotad/rpc.rquotad.c
index 1d56de0b70..af28bc32e9 100644
--- a/usr/src/cmd/fs.d/nfs/rquotad/rpc.rquotad.c
+++ b/usr/src/cmd/fs.d/nfs/rquotad/rpc.rquotad.c
@@ -406,15 +406,11 @@ sendreply:
}
int
-quotactl(cmd, mountp, uid, dqp)
- int cmd;
- char *mountp;
- uid_t uid;
- struct dqblk *dqp;
+quotactl(int cmd, char *mountp, uid_t uid, struct dqblk *dqp)
{
- int fd;
- int status;
- struct quotctl quota;
+ int fd;
+ int status;
+ struct quotctl quota;
char mountpoint[256];
FILE *fstab;
struct mnttab mntp;
@@ -430,7 +426,7 @@ quotactl(cmd, mountp, uid, dqp)
return (-1);
}
fd = -1;
- while ((status = getmntent(fstab, &mntp)) == NULL) {
+ while ((status = getmntent(fstab, &mntp)) == 0) {
if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) != 0 ||
!(hasmntopt(&mntp, MNTOPT_RQ) ||
hasmntopt(&mntp, MNTOPT_QUOTA)))
@@ -480,7 +476,7 @@ findfsq(char *dir)
{
struct stat sb;
struct fsquot *fsqp;
- static time_t lastmtime = 0; /* mount table's previous mtime */
+ static time_t lastmtime = 0; /* mount table's previous mtime */
/*
* If we've never looked at the mount table, or it has changed
diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_proc.c b/usr/src/cmd/fs.d/nfs/statd/sm_proc.c
index 00d8d59f89..cf662c97f8 100644
--- a/usr/src/cmd/fs.d/nfs/statd/sm_proc.c
+++ b/usr/src/cmd/fs.d/nfs/statd/sm_proc.c
@@ -33,7 +33,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -681,7 +681,7 @@ send_notice(char *mon_name, int state)
* to notify. If error, print out msg, free
* resources and continue.
*/
- if (thr_create(NULL, NULL, thr_send_notice,
+ if (thr_create(NULL, 0, thr_send_notice,
minfop, THR_DETACHED, NULL)) {
syslog(LOG_ERR, "statd: unable to "
"create thread to send_notice to "
diff --git a/usr/src/cmd/fs.d/pcfs/fsck/clusters.c b/usr/src/cmd/fs.d/pcfs/fsck/clusters.c
index 43225fea91..6e516857e2 100644
--- a/usr/src/cmd/fs.d/pcfs/fsck/clusters.c
+++ b/usr/src/cmd/fs.d/pcfs/fsck/clusters.c
@@ -25,8 +25,6 @@
* Copyright (c) 2016 by Delphix. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* fsck_pcfs -- routines for manipulating clusters.
*/
@@ -367,7 +365,7 @@ writeCachedCluster(int fd, CachedCluster *clustInfo)
gettext("Allocation unit %d modified.\n"),
clustInfo->clusterNum);
- if (seekCluster(fd, clustInfo->clusterNum) == NULL)
+ if (seekCluster(fd, clustInfo->clusterNum) == 0)
return;
if ((bytesWritten = write(fd, clustInfo->clusterData.bytes,
diff --git a/usr/src/cmd/fs.d/smbclnt/fksmbcl/fksmbcl_main.c b/usr/src/cmd/fs.d/smbclnt/fksmbcl/fksmbcl_main.c
index 8b1757ea62..4901a8aaed 100644
--- a/usr/src/cmd/fs.d/smbclnt/fksmbcl/fksmbcl_main.c
+++ b/usr/src/cmd/fs.d/smbclnt/fksmbcl/fksmbcl_main.c
@@ -243,7 +243,7 @@ do_logon(int argc, char **argv)
if (argc > 2)
smb_ctx_setdomain(ctx, argv[2], B_TRUE);
if (argc > 3)
- smb_ctx_setpassword(ctx, argv[3], NULL);
+ smb_ctx_setpassword(ctx, argv[3], 0);
/*
* Resolve the server address, setup derived defaults.
diff --git a/usr/src/cmd/fs.d/udfs/fsck/setup.c b/usr/src/cmd/fs.d/udfs/fsck/setup.c
index 802ecee3d5..01df08456e 100644
--- a/usr/src/cmd/fs.d/udfs/fsck/setup.c
+++ b/usr/src/cmd/fs.d/udfs/fsck/setup.c
@@ -4,7 +4,7 @@
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* Copyright (c) 1980, 1986, 1990 The Regents of the University of California.
@@ -71,7 +71,7 @@ extern char *tagerrs[];
#define POWEROF2(num) (((num) & ((num) - 1)) == 0)
extern int mflag;
-extern char hotroot;
+extern char hotroot;
char avdbuf[MAXBSIZE]; /* buffer for anchor volume descriptor */
char *main_vdbuf; /* buffer for entire main volume sequence */
@@ -132,7 +132,7 @@ restat:
errexit(gettext("Can't open checklist file: %s\n"),
VFSTAB);
}
- while (getvfsent(vfstab, &vfsbuf) == NULL) {
+ while (getvfsent(vfstab, &vfsbuf) == 0) {
if (strcmp(devstr, vfsbuf.vfs_mountp) == 0) {
if (strcmp(vfsbuf.vfs_fstype,
MNTTYPE_UDFS) != 0) {
diff --git a/usr/src/cmd/fs.d/udfs/fsck/utilities.c b/usr/src/cmd/fs.d/udfs/fsck/utilities.c
index 2deb71a9eb..257dad8c96 100644
--- a/usr/src/cmd/fs.d/udfs/fsck/utilities.c
+++ b/usr/src/cmd/fs.d/udfs/fsck/utilities.c
@@ -3,7 +3,7 @@
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* Copyright (c) 1980, 1986, 1990 The Regents of the University of California.
@@ -521,7 +521,7 @@ mounted(char *name)
return (0);
}
blkname = unrawname(name);
- while ((getmntent(mnttab, &mnt)) == NULL) {
+ while ((getmntent(mnttab, &mnt)) == 0) {
if (strcmp(mnt.mnt_fstype, MNTTYPE_UDFS) != 0) {
continue;
}
@@ -536,7 +536,7 @@ mounted(char *name)
if (hasmntopt(&mnt, MNTOPT_RO) != 0)
found = 2; /* mounted as RO */
else
- found = 1; /* mounted as R/W */
+ found = 1; /* mounted as R/W */
}
break;
}
diff --git a/usr/src/cmd/fs.d/udfs/fsdb/Makefile b/usr/src/cmd/fs.d/udfs/fsdb/Makefile
index 5c17537f20..7c5c2494ab 100644
--- a/usr/src/cmd/fs.d/udfs/fsdb/Makefile
+++ b/usr/src/cmd/fs.d/udfs/fsdb/Makefile
@@ -37,6 +37,7 @@ MAPFILES += $(MAPFILE.INT) $(MAPFILE.LEX) $(MAPFILE.NGB)
MAPOPTS = $(MAPFILES:%=-M%)
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CPPFLAGS += -I../fstyp
LDLIBS += -lmalloc -ll -ladm
LDFLAGS += $(MAPOPTS)
YFLAGS = "-d"
@@ -51,10 +52,11 @@ CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-unused-value
CERRWARN += -_gcc=-Wno-unused-function
+
# not linted
SMATCH=off
-SRCS= fsdb.c ud_lib.c
+SRCS= fsdb.c ../fstyp/ud_lib.c
fsdb : fsdb_yacc.o fsdb_lex.o ud_lib.o fsdb.o $(MAPFILES)
$(LINK.c) -o $@ fsdb.o fsdb_yacc.o fsdb_lex.o \
@@ -65,18 +67,10 @@ fsdb.o : fsdb.c
$(COMPILE.c) -o $@ fsdb.c
$(POST_PROCESS_O)
-ud_lib.o : ud_lib.c ud_lib.h
- $(COMPILE.c) -o $@ ud_lib.c
+ud_lib.o : ../fstyp/ud_lib.c ../fstyp/ud_lib.h
+ $(COMPILE.c) -o $@ ../fstyp/ud_lib.c
$(POST_PROCESS_O)
-ud_lib.c : ../fstyp/ud_lib.c
- $(RM) $@
- $(CP) ../fstyp/ud_lib.c $@
-
-ud_lib.h : ../fstyp/ud_lib.h
- $(RM) $@
- $(CP) ../fstyp/ud_lib.h $@
-
y.tab.c : fsdb_yacc.y
$(YACC.y) fsdb_yacc.y
@@ -92,7 +86,7 @@ fsdb_lex.o : lex.yy.c
$(POST_PROCESS_O)
clean :
- $(RM) ud_lib.c ud_lib.h fsdb.o ud_lib.o fsdb_yacc.o fsdb_lex.o
+ $(RM) fsdb.o ud_lib.o fsdb_yacc.o fsdb_lex.o
$(RM) fsdb_yacc.c fsdb_lex.c y.tab.c y.tab.h lex.yy.c
# for messaging catalog
@@ -105,7 +99,7 @@ catalog: $(POFILE)
CATSRCS= $(SRCS) lex.yy.c y.tab.c
-$(POFILE): $(CATSRCS) ud_lib.h
+$(POFILE): $(CATSRCS) ../fstyp/ud_lib.h
$(RM) $@
$(COMPILE.cpp) $(CATSRCS) > $(POFILE).i
$(XGETTEXT) $(XGETFLAGS) $(POFILE).i
diff --git a/usr/src/cmd/fs.d/udfs/fsdb/fsdb.c b/usr/src/cmd/fs.d/udfs/fsdb/fsdb.c
index e98cf1aec0..df32173c13 100644
--- a/usr/src/cmd/fs.d/udfs/fsdb/fsdb.c
+++ b/usr/src/cmd/fs.d/udfs/fsdb/fsdb.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -369,7 +367,7 @@ print_desc(uint32_t addr, int32_t id)
* find out the type of tag
* and print the descriptor
*/
- if (addr != NULL) {
+ if (addr != 0) {
if ((baddr = getblk(addr & (~bmask))) == NULL) {
(void) fprintf(stdout,
gettext("Could not read block %x\n"),
diff --git a/usr/src/cmd/fs.d/udfs/fstyp/ud_lib.c b/usr/src/cmd/fs.d/udfs/fstyp/ud_lib.c
index 10ab2009b6..f42c6eea0b 100644
--- a/usr/src/cmd/fs.d/udfs/fstyp/ud_lib.c
+++ b/usr/src/cmd/fs.d/udfs/fstyp/ud_lib.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
@@ -1231,7 +1229,7 @@ UdfTxName(uint16_t *unicode, int32_t count)
dot_loc = j;
}
if ((unicode[i] == SLASH) ||
- (unicode[i] == NULL)) {
+ (unicode[i] == 0)) {
if (make_crc == 0) {
for (k = 0; k <= i; k++) {
crc += unicode[k];
diff --git a/usr/src/cmd/fs.d/udfs/labelit/Makefile b/usr/src/cmd/fs.d/udfs/labelit/Makefile
index 24a0592f0f..51c22de0b5 100644
--- a/usr/src/cmd/fs.d/udfs/labelit/Makefile
+++ b/usr/src/cmd/fs.d/udfs/labelit/Makefile
@@ -27,13 +27,14 @@
FSTYPE= udfs
LIBPROG= labelit
-SRCS= labelit.c ud_lib.c
+SRCS= labelit.c
ATTMK= $(LIBPROG)
include ../../Makefile.fstype
LDLIBS += -ladm
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CPPFLAGS += -I../fstyp
LINTFLAGS += -xerroff=E_STATIC_UNUSED
LINTFLAGS64 += -xerroff=E_STATIC_UNUSED
@@ -45,17 +46,11 @@ labelit : labelit.o ud_lib.o
$(LINK.c) -o $@ labelit.o ud_lib.o $(LDLIBS)
$(POST_PROCESS)
-labelit.o : labelit.c ud_lib.h
+labelit.o : labelit.c ../fstyp/ud_lib.h
-ud_lib.o : ud_lib.c ud_lib.h
-
-ud_lib.h : ../fstyp/ud_lib.h
- rm -f ud_lib.h
- cp ../fstyp/ud_lib.h ud_lib.h
-
-ud_lib.c : ../fstyp/ud_lib.c
- rm -f ud_lib.c
- cp ../fstyp/ud_lib.c ud_lib.c
+ud_lib.o : ../fstyp/ud_lib.c ../fstyp/ud_lib.h
+ $(COMPILE.c) -o $@ ../fstyp/ud_lib.c
+ $(POST_PROCESS_O)
# for messaging catalog
#
@@ -65,7 +60,7 @@ POFILE= labelit.po
#
catalog: $(POFILE)
-$(POFILE): $(SRCS) ud_lib.h
+$(POFILE): $(SRCS) ../fstyp/ud_lib.h
$(RM) $@
$(COMPILE.cpp) $(SRCS) > $(POFILE).i
$(XGETTEXT) $(XGETFLAGS) $(POFILE).i
@@ -74,12 +69,8 @@ $(POFILE): $(SRCS) ud_lib.h
clean :
rm -f labelit.o ud_lib.o
- rm -f ud_lib.c ud_lib.h
lint:
- rm -f ud_lib.h
- cp ../fstyp/ud_lib.h ud_lib.h
- cp ../fstyp/ud_lib.c ud_lib.c
$(LINT.c) -mu $(SRCS)
putback:
diff --git a/usr/src/cmd/fs.d/udfs/mkfs/mkfs.c b/usr/src/cmd/fs.d/udfs/mkfs/mkfs.c
index afbc770565..2b4f4e3243 100644
--- a/usr/src/cmd/fs.d/udfs/mkfs/mkfs.c
+++ b/usr/src/cmd/fs.d/udfs/mkfs/mkfs.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
@@ -64,7 +64,7 @@
#include <sys/filio.h>
#include <sys/stat.h>
#include <ustat.h>
-#include <sys/isa_defs.h> /* for ENDIAN defines */
+#include <sys/isa_defs.h> /* for ENDIAN defines */
#include <sys/dkio.h>
#include <sys/fdio.h>
#include <sys/vtoc.h>
@@ -296,7 +296,7 @@ main(int32_t argc, int8_t *argv[])
if ((temp_secsz = get_bsize()) != 0) {
sectorsize = temp_secsz;
}
-
+
/* Get old file system information */
isfs = readvolseq();
@@ -376,7 +376,7 @@ main(int32_t argc, int8_t *argv[])
*/
if ((special != NULL) && (*special != '\0')) {
mnttab = fopen(MNTTAB, "r");
- while ((getmntent(mnttab, &mntp)) == NULL) {
+ while ((getmntent(mnttab, &mntp)) == 0) {
if (strcmp(special, mntp.mnt_special) == 0) {
(void) fprintf(stdout,
gettext("%s is mounted,"
diff --git a/usr/src/cmd/fs.d/ufs/df/df.c b/usr/src/cmd/fs.d/ufs/df/df.c
index 0c3db346c4..0cd9b41959 100644
--- a/usr/src/cmd/fs.d/ufs/df/df.c
+++ b/usr/src/cmd/fs.d/ufs/df/df.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -67,7 +67,7 @@ extern off_t lseek();
* Raw name to block device name translation function.
* This comes from libadm.
*/
-extern char *getfullblkname();
+extern char *getfullblkname();
static void usage(), pheader();
static char *mpath(char *);
@@ -84,7 +84,7 @@ static void dfreemnt(char *, struct mnttab *);
static void print_totals();
static void print_itotals();
static void print_statvfs(struct statvfs64 *);
-static int mdev(char *, struct mnttab **);
+static int mdev(char *, struct mnttab **);
static struct mntlist *mkmntlist();
static struct mnttab *mntdup(struct mnttab *mnt);
static struct mntlist *findmntent(char *, struct stat64 *, struct mntlist *);
@@ -109,7 +109,7 @@ int iflag = 0; /* information for inodes */
int nflag = 0; /* print VFStype name */
int tflag = 0; /* print totals */
int errflag = 0;
-int errcode = 0;
+int errcode = 0;
char *typestr = "ufs";
fsblkcnt64_t t_totalblks, t_avail, t_free, t_used, t_reserved;
int t_inodes, t_iused, t_ifree;
@@ -150,7 +150,7 @@ char *subopts [] = {
int
main(int argc, char *argv[])
{
- struct mnttab mnt;
+ struct mnttab mnt;
int opt;
char *suboptions, *value;
@@ -253,7 +253,7 @@ main(int argc, char *argv[])
* Take this path when "/usr/lib/fs/ufs/df" is specified, and
* there are no mountpoints specified.
* E.g., these command lines take us down this path
- * /usr/lib/fs/ufs/df -o i
+ * /usr/lib/fs/ufs/df -o i
* /usr/lib/fs/ufs/df
*/
FILE *mtabp;
@@ -1031,7 +1031,7 @@ mkmntlist()
exit(1);
}
resetmnttab(mounted);
- while (getextmntent(mounted, &mnt, sizeof (struct extmnttab)) == NULL) {
+ while (getextmntent(mounted, &mnt, sizeof (struct extmnttab)) == 0) {
mntl = (struct mntlist *)xmalloc(sizeof (*mntl));
mntl->mntl_mnt = mntdup((struct mnttab *)(&mnt));
mntl->mntl_next = mntst;
diff --git a/usr/src/cmd/fs.d/ufs/edquota/edquota.c b/usr/src/cmd/fs.d/ufs/edquota/edquota.c
index 385a75ea83..30794f20ec 100644
--- a/usr/src/cmd/fs.d/ufs/edquota/edquota.c
+++ b/usr/src/cmd/fs.d/ufs/edquota/edquota.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -37,8 +37,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Disk quota editor.
*/
@@ -842,7 +840,7 @@ quotactl(int cmd, char *special, uid_t uid, caddr_t addr)
exit(31+1);
}
qfile[0] = '\0';
- while ((status = getmntent(fstab, &mntp)) == NULL) {
+ while ((status = getmntent(fstab, &mntp)) == 0) {
/*
* check that it is a ufs file system
* for all quotactl()s except Q_ALLSYNC check that
diff --git a/usr/src/cmd/fs.d/ufs/fsck/main.c b/usr/src/cmd/fs.d/ufs/fsck/main.c
index 1ade794d01..95a1c4308e 100644
--- a/usr/src/cmd/fs.d/ufs/fsck/main.c
+++ b/usr/src/cmd/fs.d/ufs/fsck/main.c
@@ -4,7 +4,7 @@
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
@@ -495,7 +495,7 @@ recount:
while (limbo_dirs != NULL) {
limbo_victim = *(fsck_ino_t *)limbo_dirs;
- if (limbo_victim != NULL) {
+ if (limbo_victim != 0) {
(void) tdelete((void *)limbo_victim,
&limbo_dirs,
ino_t_cmp);
diff --git a/usr/src/cmd/fs.d/ufs/fsdb/fsdb.c b/usr/src/cmd/fs.d/ufs/fsdb/fsdb.c
index 17ea9f99f2..1fee268983 100644
--- a/usr/src/cmd/fs.d/ufs/fsdb/fsdb.c
+++ b/usr/src/cmd/fs.d/ufs/fsdb/fsdb.c
@@ -472,7 +472,7 @@ main(int argc, char *argv[])
* Unless it's already been set, the default prompt includes the
* name of the special device.
*/
- if (*prompt == NULL)
+ if (*prompt == '\0')
(void) sprintf(prompt, "%s > ", special);
/*
@@ -1152,13 +1152,13 @@ OTX:
colon = 0;
else
goto no_colon;
- if (match("at", 2)) { /* access time */
+ if (match("at", 2)) { /* access time */
acting_on_inode = 2;
should_print = 1;
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_atime;
value = get(LONG);
- type = NULL;
+ type = 0;
continue;
}
goto bad_syntax;
@@ -1168,7 +1168,7 @@ OTX:
colon = 0;
else
goto no_colon;
- if (match("block", 2)) { /* block conversion */
+ if (match("block", 2)) { /* block conversion */
if (type == NUMB) {
value = addr;
cur_bytes = 0;
@@ -1191,7 +1191,7 @@ OTX:
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_blocks;
value = get(LONG);
- type = NULL;
+ type = 0;
continue;
}
if (match("base", 2)) { /* change/show base */
@@ -1301,7 +1301,7 @@ showbase:
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_ctime;
value = get(LONG);
- type = NULL;
+ type = 0;
continue;
}
goto bad_syntax;
@@ -1311,7 +1311,7 @@ showbase:
colon = 0;
else
goto no_colon;
- if (match("directory", 2)) { /* directory offsets */
+ if (match("directory", 2)) { /* directory offsets */
if (type == NUMB)
value = addr;
objsz = DIRECTORY;
@@ -1435,7 +1435,7 @@ showbase:
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_gid;
value = get(SHORT);
- type = NULL;
+ type = 0;
continue;
}
goto bad_syntax;
@@ -1449,7 +1449,7 @@ showbase:
if (c_count == 2) {
addr = cur_ino;
value = get(INODE);
- type = NULL;
+ type = 0;
laststyle = '=';
lastpo = 'i';
should_print = 1;
@@ -1463,7 +1463,7 @@ showbase:
cur_ino = addr;
cur_inum = (long)value;
value = get(INODE);
- type = NULL;
+ type = 0;
continue;
}
if (match("ib", 2)) { /* indirect block */
@@ -1592,7 +1592,7 @@ showbase:
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_nlink;
value = get(SHORT);
- type = NULL;
+ type = 0;
continue;
}
goto bad_syntax;
@@ -1605,13 +1605,13 @@ showbase:
addr = cur_ino;
if ((mode = icheck(addr)) == 0)
continue;
- if (match("mt", 2)) { /* modification time */
+ if (match("mt", 2)) { /* modification time */
acting_on_inode = 2;
should_print = 1;
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_mtime;
value = get(LONG);
- type = NULL;
+ type = 0;
continue;
}
if (match("md", 2)) { /* mode */
@@ -1620,7 +1620,7 @@ showbase:
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_mode;
value = get(SHORT);
- type = NULL;
+ type = 0;
continue;
}
if (match("maj", 2)) { /* major device number */
@@ -1635,7 +1635,7 @@ showbase:
dvalue = get(LONG);
value = major(dvalue);
}
- type = NULL;
+ type = 0;
continue;
}
if (match("min", 2)) { /* minor device number */
@@ -1650,7 +1650,7 @@ showbase:
dvalue = (long)get(LONG);
value = minor(dvalue);
}
- type = NULL;
+ type = 0;
continue;
}
goto bad_syntax;
@@ -1673,7 +1673,7 @@ showbase:
(long)&dirp->d_ino);
addr = (long)&((struct direct *)
(uintptr_t)addr)->d_name[0];
- type = NULL;
+ type = 0;
continue;
}
goto bad_syntax;
@@ -1783,7 +1783,7 @@ showbase:
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_shadow;
value = get(LONG);
- type = NULL;
+ type = 0;
continue;
}
@@ -1793,7 +1793,7 @@ showbase:
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_size;
value = get(U_OFFSET_T);
- type = NULL;
+ type = 0;
objsz = U_OFFSET_T;
laststyle = '=';
lastpo = 'X';
@@ -1812,7 +1812,7 @@ showbase:
addr = (long)&((struct dinode *)
(uintptr_t)cur_ino)->di_uid;
value = get(SHORT);
- type = NULL;
+ type = 0;
continue;
}
goto bad_syntax;
@@ -2709,7 +2709,7 @@ compare(char *s1, char *s2, short at_start)
char c, *s;
s = s2;
- while ((c = *s1) != NULL) {
+ while ((c = *s1) != '\0') {
if (c == '*') {
if (at_start && s == s2 && !letter(*s2) && !digit(*s2))
return (0);
@@ -4911,11 +4911,11 @@ old_fsdb(int inum, char *special)
static int
isnumber(char *s)
{
- register int c;
+ int c;
if (s == NULL)
return (0);
- while ((c = *s++) != NULL)
+ while ((c = *s++) != '\0')
if (c < '0' || c > '9')
return (0);
return (1);
diff --git a/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c b/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c
index 0098b56082..940827d156 100644
--- a/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c
+++ b/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c
@@ -1440,7 +1440,7 @@ retry_alternate_logic:
"can't open %s\n"), MNTTAB);
exit(32);
}
- while ((getmntent(mnttab, &mntp)) == NULL) {
+ while ((getmntent(mnttab, &mntp)) == 0) {
if (grow) {
checkmount(&mntp, special);
continue;
diff --git a/usr/src/cmd/fs.d/ufs/quot/quot.c b/usr/src/cmd/fs.d/ufs/quot/quot.c
index 674c710548..6f03d72d9f 100644
--- a/usr/src/cmd/fs.d/ufs/quot/quot.c
+++ b/usr/src/cmd/fs.d/ufs/quot/quot.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -36,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* quot
*/
@@ -200,7 +198,7 @@ quotall()
(void) fprintf(stderr, "quot: no %s file\n", MNTTAB);
exit(32);
}
- while (getmntent(fstab, &mntp) == NULL) {
+ while (getmntent(fstab, &mntp) == 0) {
if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) != 0)
continue;
@@ -252,7 +250,7 @@ check(char *file, char *fsdir)
(void) fprintf(stderr, "quot: no %s file\n", MNTTAB);
exit(32);
}
- while (getmntent(fstab, &mntp) == NULL) {
+ while (getmntent(fstab, &mntp) == 0) {
if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) != 0)
continue;
if (strcmp(mntp.mnt_special, file) == 0) {
@@ -489,7 +487,7 @@ getdev(char **devpp)
(void) fprintf(stderr, "quot: no %s file\n", MNTTAB);
exit(32);
}
- while (getmntent(fstab, &mntp) == NULL) {
+ while (getmntent(fstab, &mntp) == 0) {
if (strcmp(mntp.mnt_mountp, *devpp) == 0) {
if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) != 0) {
(void) fprintf(stderr,
@@ -585,7 +583,7 @@ static void
cleanup()
{
int i;
- struct du *ep, *next;
+ struct du *ep, *next;
/*
* Release memory from hash table and du
diff --git a/usr/src/cmd/fs.d/ufs/quota/quota.c b/usr/src/cmd/fs.d/ufs/quota/quota.c
index 9cd622b7e1..b938802a6b 100644
--- a/usr/src/cmd/fs.d/ufs/quota/quota.c
+++ b/usr/src/cmd/fs.d/ufs/quota/quota.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -264,7 +264,7 @@ showquotas(uid_t uid, char *name)
if (vflag)
heading(uid, name);
mtab = fopen(MNTTAB, "r");
- while (getmntent(mtab, &mnt) == NULL) {
+ while (getmntent(mtab, &mnt) == 0) {
if (strcmp(mnt.mnt_fstype, MNTTYPE_ZFS) == 0) {
bzero(&dqblk, sizeof (dqblk));
if (getzfsquota(name, mnt.mnt_special, &dqblk))
@@ -684,7 +684,7 @@ quotactl(int cmd, char *mountp, uid_t uid, caddr_t addr)
zexit(32);
}
fd = -1;
- while ((status = getmntent(fstab, &mnt)) == NULL) {
+ while ((status = getmntent(fstab, &mnt)) == 0) {
if (strcmp(mnt.mnt_fstype, MNTTYPE_UFS) != 0 ||
hasopt(MNTOPT_RO, mnt.mnt_mntopts))
continue;
@@ -823,7 +823,7 @@ getnfsquota(char *hostp, char *path, uid_t uid, struct dqblk *dqp)
int
callaurpc(char *host, int prognum, int versnum, int procnum,
- xdrproc_t inproc, char *in, xdrproc_t outproc, char *out)
+ xdrproc_t inproc, char *in, xdrproc_t outproc, char *out)
{
static enum clnt_stat clnt_stat;
struct timeval tottimeout = {20, 0};
diff --git a/usr/src/cmd/fs.d/ufs/quotacheck/quotacheck.c b/usr/src/cmd/fs.d/ufs/quotacheck/quotacheck.c
index da65acae36..69cf325b4c 100644
--- a/usr/src/cmd/fs.d/ufs/quotacheck/quotacheck.c
+++ b/usr/src/cmd/fs.d/ufs/quotacheck/quotacheck.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -36,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Fix up / report on disc quotas & usage
*/
@@ -194,7 +192,7 @@ main(int argc, char **argv)
perror(VFSTAB);
exit(31+8);
}
- while (getvfsent(vfstab, &vfsbuf) == NULL) {
+ while (getvfsent(vfstab, &vfsbuf) == 0) {
if (strcmp(vfsbuf.vfs_fstype, MNTTYPE_UFS) != 0 ||
(vfsbuf.vfs_mntopts == 0) ||
hasvfsopt(&vfsbuf, MNTOPT_RO) ||
@@ -233,7 +231,7 @@ main(int argc, char **argv)
perror(MNTTAB);
exit(31+8);
}
- while (getmntent(mtab, &mntp) == NULL) {
+ while (getmntent(mtab, &mntp) == 0) {
if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) == 0 &&
!hasmntopt(&mntp, MNTOPT_RO) &&
(oneof(mntp.mnt_special, listp, listcnt) ||
@@ -701,8 +699,8 @@ usage()
int
quotactl(int cmd, char *mountp, uid_t uid, caddr_t addr)
{
- int fd;
- int status;
+ int fd;
+ int status;
struct quotctl quota;
char qfile[MAXPATHLEN];
FILE *fstab;
@@ -721,7 +719,7 @@ quotactl(int cmd, char *mountp, uid_t uid, caddr_t addr)
exit(31+1);
}
fd = -1;
- while ((status = getmntent(fstab, &mntp)) == NULL) {
+ while ((status = getmntent(fstab, &mntp)) == 0) {
if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) != 0 ||
hasmntopt(&mntp, MNTOPT_RO))
continue;
diff --git a/usr/src/cmd/fs.d/ufs/quotaon/quotaon.c b/usr/src/cmd/fs.d/ufs/quotaon/quotaon.c
index bd93f45812..7197f707f7 100644
--- a/usr/src/cmd/fs.d/ufs/quotaon/quotaon.c
+++ b/usr/src/cmd/fs.d/ufs/quotaon/quotaon.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -36,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Turn quota on/off for a filesystem.
*/
@@ -166,7 +164,7 @@ main(int argc, char **argv)
exit(31+1);
}
- while ((status = getvfsent(vfstab, &vfsbuf)) == NULL) {
+ while ((status = getvfsent(vfstab, &vfsbuf)) == 0) {
if (strcmp(vfsbuf.vfs_fstype, MNTTYPE_UFS) != 0 ||
(vfsbuf.vfs_mntopts == 0) ||
hasvfsopt(&vfsbuf, MNTOPT_RO) ||
@@ -222,7 +220,7 @@ main(int argc, char **argv)
* Loop through mnttab, if a file system gets turned on or off
* do the quota call.
*/
- while ((status = getmntent(mtab, &mntp)) == NULL) {
+ while ((status = getmntent(mtab, &mntp)) == 0) {
if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) == 0 &&
!hasmntopt(&mntp, MNTOPT_RO) &&
(oneof(mntp.mnt_special, listp, listcnt) ||
diff --git a/usr/src/cmd/fs.d/ufs/repquota/repquota.c b/usr/src/cmd/fs.d/ufs/repquota/repquota.c
index 6a0aea3dc5..6d7f25b7f8 100644
--- a/usr/src/cmd/fs.d/ufs/repquota/repquota.c
+++ b/usr/src/cmd/fs.d/ufs/repquota/repquota.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -36,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Quota report
*/
@@ -452,7 +450,7 @@ quotactl(int cmd, char *special, uid_t uid, caddr_t addr)
exit(31+1);
}
fd = -1;
- while ((status = getmntent(fstab, &mntp)) == NULL) {
+ while ((status = getmntent(fstab, &mntp)) == 0) {
if (strcmp(mntp.mnt_fstype, MNTTYPE_UFS) != 0 ||
hasmntopt(&mntp, MNTOPT_RO))
diff --git a/usr/src/cmd/fs.d/ufs/roll_log/roll_log.c b/usr/src/cmd/fs.d/ufs/roll_log/roll_log.c
index 2d2a4749d5..6099a36d05 100644
--- a/usr/src/cmd/fs.d/ufs/roll_log/roll_log.c
+++ b/usr/src/cmd/fs.d/ufs/roll_log/roll_log.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* This file contains functions that allow applications to roll the log.
* It is intended for use by applications that open a raw device with the
@@ -208,12 +206,12 @@ is_mounted(log_info_t *lip, char *dev)
/* Search mnttab to see if it device is mounted. */
if ((mnttable = fopen(MNTTAB, "r")) == NULL)
return (rv);
- while (getmntent(mnttable, &mntbuf) == NULL) {
+ while (getmntent(mnttable, &mntbuf) == 0) {
if (strcmp(mntbuf.mnt_fstype, MNTTYPE_UFS) == 0) {
/* Entry is UFS */
if ((strcmp(mntbuf.mnt_mountp, dev) == 0) ||
(strcmp(mntbuf.mnt_special, lip->li_blkname)
- == 0) ||
+ == 0) ||
(strcmp(mntbuf.mnt_special, dev) == 0)) {
lip->li_mntpoint = strdup(mntbuf.mnt_mountp);
rv = RL_TRUE;
@@ -251,7 +249,7 @@ make_mp(log_info_t *lip)
* Note tmp_dir_list[] should all be directories in the
* original root file system.
*/
- static const char *tmp_dir_list[] = {
+ static const char *tmp_dir_list[] = {
"/tmp/",
"/var/tmp/",
"/",
@@ -260,7 +258,7 @@ make_mp(log_info_t *lip)
char tmp_dir[MAXPATHLEN + 1];
char mountpt_dir[MAXPATHLEN + 1];
static size_t list_len = sizeof (tmp_dir_list) /
- sizeof (const char *);
+ sizeof (const char *);
int merr = 0;
/*
@@ -276,7 +274,7 @@ make_mp(log_info_t *lip)
for (i = 0; i < list_len; i++) {
/* Make the directory containing the mount-point */
(void) snprintf(tmp_dir, sizeof (tmp_dir), "%s%s",
- tmp_dir_list[i], dirname);
+ tmp_dir_list[i], dirname);
if (mkdir(tmp_dir, 0) == SYSERR) {
merr = errno;
continue;
@@ -284,7 +282,7 @@ make_mp(log_info_t *lip)
/* Now, make the mount-point */
(void) snprintf(mountpt_dir, sizeof (mountpt_dir), "%s/%s",
- tmp_dir, dirname);
+ tmp_dir, dirname);
if (mkdir(mountpt_dir, 0) == SYSERR) {
merr = errno;
continue;
@@ -315,15 +313,15 @@ make_mp(log_info_t *lip)
}
(void) fprintf(stderr, gettext(
- "Unable to create temporary "
- "directory in any of the directories listed "
- "below:\n"));
+ "Unable to create temporary "
+ "directory in any of the directories listed "
+ "below:\n"));
for (i = 0; i < list_len; i++) {
(void) fprintf(stderr, "\t%s\n", tmp_dir_list[i]);
}
(void) fprintf(stderr, gettext(
- "Please correct this problem "
- "and rerun the program.\n"));
+ "Please correct this problem "
+ "and rerun the program.\n"));
}
return (rv);
@@ -349,7 +347,7 @@ rlflush(log_info_t *lip)
rl_result_t rv = RL_SUCCESS;
if ((fd = open((lip->li_mntpoint ? lip->li_mntpoint : lip->li_tmpmp),
- O_RDONLY)) == SYSERR) {
+ O_RDONLY)) == SYSERR) {
return (RL_SYSERR);
}
if (ioctl(fd, _FIOFFS, NULL) == SYSERR) {
@@ -403,11 +401,11 @@ rlmount(log_info_t *lip, int mntopt)
return (RL_FAIL);
}
(void) snprintf(opt, sizeof (opt), "%s,%s,%s",
- optstr, MNTOPT_NOSUID, MNTOPT_LARGEFILES);
+ optstr, MNTOPT_NOSUID, MNTOPT_LARGEFILES);
if (mount(lip->li_blkname, lip->li_tmpmp,
- optflg | MS_DATA | MS_OPTIONSTR,
- MNTTYPE_UFS, &args, sizeof (args),
- opt, MAX_MNTOPT_STR) == SYSERR) {
+ optflg | MS_DATA | MS_OPTIONSTR,
+ MNTTYPE_UFS, &args, sizeof (args),
+ opt, MAX_MNTOPT_STR) == SYSERR) {
rv = RL_SYSERR;
}
return (rv);
@@ -432,8 +430,8 @@ rlumount(log_info_t *lip)
if (umount(lip->li_blkname) == SYSERR) {
(void) fprintf(stderr, gettext(
- "WARNING: rlumount(): Can't unmount %s\n"),
- lip->li_blkname);
+ "WARNING: rlumount(): Can't unmount %s\n"),
+ lip->li_blkname);
rv = RL_SYSERR;
}
return (rv);
diff --git a/usr/src/cmd/fs.d/ufs/tunefs/tunefs.c b/usr/src/cmd/fs.d/ufs/tunefs/tunefs.c
index 510eafe5e8..319866051b 100644
--- a/usr/src/cmd/fs.d/ufs/tunefs/tunefs.c
+++ b/usr/src/cmd/fs.d/ufs/tunefs/tunefs.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -36,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* tunefs: change layout parameters to an existing file system.
*/
@@ -108,7 +106,7 @@ searchvfstab(char **specialp)
fprintf(stderr, "%s: ", VFSTAB);
perror("open");
}
- while (getvfsent(vfstab, &vfsbuf) == NULL)
+ while (getvfsent(vfstab, &vfsbuf) == 0)
if (strcmp(vfsbuf.vfs_fstype, MNTTYPE_UFS) == 0)
if ((strcmp(vfsbuf.vfs_mountp, *specialp) == 0) ||
(strcmp(vfsbuf.vfs_special, *specialp) == 0) ||
@@ -133,7 +131,7 @@ searchmnttab(char **specialp, char **mountpointp)
if ((mnttab = fopen(MNTTAB, "r")) == NULL)
return;
- while (getmntent(mnttab, &mntbuf) == NULL)
+ while (getmntent(mnttab, &mntbuf) == 0)
if (strcmp(mntbuf.mnt_fstype, MNTTYPE_UFS) == 0)
if ((strcmp(mntbuf.mnt_mountp, *specialp) == 0) ||
(strcmp(mntbuf.mnt_special, blockspecial) == 0) ||
diff --git a/usr/src/cmd/fs.d/ufs/volcopy/volcopy.c b/usr/src/cmd/fs.d/ufs/volcopy/volcopy.c
index f228b187d1..48fb0b98e7 100644
--- a/usr/src/cmd/fs.d/ufs/volcopy/volcopy.c
+++ b/usr/src/cmd/fs.d/ufs/volcopy/volcopy.c
@@ -24,7 +24,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -36,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/param.h>
#include <signal.h>
#include <sys/types.h>
@@ -141,25 +139,25 @@ time_t Tvec;
FILE *Devtty;
-static void getinfs(),
+static void getinfs(),
getoutfs();
-static char *getfslabel(struct fs *);
-static char *getvolabel(struct fs *);
+static char *getfslabel(struct fs *);
+static char *getvolabel(struct fs *);
static void prompt(int, const char *, ...);
static void perr(int, const char *, ...);
-static void mklabel(void);
+static void mklabel(void);
static void get_mach_type(void);
-static void mem_setup(void);
+static void mem_setup(void);
static void rprt(void);
-static void chgreel(struct file_info *, int);
+static void chgreel(struct file_info *, int);
static void parent_copy(void);
-static void copy(void);
-static void flush_bufs(int);
-static void cleanup(void);
+static void copy(void);
+static void flush_bufs(int);
+static void cleanup(void);
#ifdef LOG
-static int fslog(void);
+static int fslog(void);
#endif /* LOG */
/*
@@ -274,10 +272,10 @@ g_write(int devtype, int fdes, void *buf, size_t nbytes)
* volcopy [-options] filesystem /dev/from From_vol /dev/to To_vol
*
* options are:
- * -feet - length of tape
- * -bpi - recording density
- * -reel - reel number (if not starting from beginning)
- * -buf - use double buffered i/o (if dens >= 1600 bpi)
+ * -feet - length of tape
+ * -bpi - recording density
+ * -reel - reel number (if not starting from beginning)
+ * -buf - use double buffered i/o (if dens >= 1600 bpi)
* -block - Set the transfer block size to NUM physical blocks (512
* bytes on 3B2 and 3B15). Note that an arbitrary block size might
* or might not work on a given system. Also, the block size
@@ -286,10 +284,10 @@ g_write(int devtype, int fdes, void *buf, size_t nbytes)
* -r - Read NUM transfer blocks from the disk at once and write it
* to the output device one block at a time. Intended only to
* boost the 3B15 EDFC disk to tape performance. Disabled on 3B2.
- * -a - ask "y or n" instead of "DEL if wrong"
- * -s - inverse of -a, from/to devices are printed followed by `?'.
- * User has 10 seconds to DEL if mistaken!
- * -y - assume "yes" response to all questions
+ * -a - ask "y or n" instead of "DEL if wrong"
+ * -s - inverse of -a, from/to devices are printed followed by `?'.
+ * User has 10 seconds to DEL if mistaken!
+ * -y - assume "yes" response to all questions
*
* Examples:
*
@@ -1245,7 +1243,7 @@ tapeck(struct file_info *f_p, int dir)
perror("output tape");
}
alarm(0);
- if (V_labl.v_reel == (char)NULL && dir == INPUT)
+ if (V_labl.v_reel == '\0' && dir == INPUT)
perr(9, "Input tape is empty\n");
else {
old_style = strncmp(V_labl.v_magic, "Volcopy", 7) == 0;