summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-10-28 07:30:36 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-10-28 07:30:36 +0000
commitdc5a52b8f13af8e77898153dd0286063cbc170e7 (patch)
tree583c0124fdc4fff026238c7589e0974b22b595b3
parent97159e2117ae33feb8fc7ee89990516e081faadc (diff)
Change some TAILQ_FIRST() == NULL tests into TAILQ_EMPTY(). The first
form is valid, but in these cases its more clear to say what you mean. ok pat@ henning@
-rw-r--r--sbin/fsck/fsck.c6
-rw-r--r--sbin/fsck/preen.c12
2 files changed, 9 insertions, 9 deletions
diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c
index 8116662fe91..703135d04d4 100644
--- a/sbin/fsck/fsck.c
+++ b/sbin/fsck/fsck.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fsck.c,v 1.20 2005/10/15 06:26:28 otto Exp $ */
+/* $OpenBSD: fsck.c,v 1.21 2005/10/28 07:30:35 otto Exp $ */
/* $NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $ */
/*
@@ -35,7 +35,7 @@
*
*/
-static const char rcsid[] = "$OpenBSD: fsck.c,v 1.20 2005/10/15 06:26:28 otto Exp $";
+static const char rcsid[] = "$OpenBSD: fsck.c,v 1.21 2005/10/28 07:30:35 otto Exp $";
#include <sys/param.h>
#include <sys/mount.h>
@@ -140,7 +140,7 @@ main(int argc, char *argv[])
break;
case 't':
- if (TAILQ_FIRST(&selhead) != NULL)
+ if (!TAILQ_EMPTY(&selhead))
errx(1, "only one -t option may be specified.");
maketypelist(optarg);
diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c
index e0b6c2f99a2..4c87b4c5684 100644
--- a/sbin/fsck/preen.c
+++ b/sbin/fsck/preen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: preen.c,v 1.15 2005/10/15 06:26:28 otto Exp $ */
+/* $OpenBSD: preen.c,v 1.16 2005/10/28 07:30:35 otto Exp $ */
/* $NetBSD: preen.c,v 1.15 1996/09/28 19:21:42 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)preen.c 8.3 (Berkeley) 12/6/94";
#else
-static const char rcsid[] = "$OpenBSD: preen.c,v 1.15 2005/10/15 06:26:28 otto Exp $";
+static const char rcsid[] = "$OpenBSD: preen.c,v 1.16 2005/10/28 07:30:35 otto Exp $";
#endif
#endif /* not lint */
@@ -197,11 +197,11 @@ checkfstab(int flags, int maxrun, void *(*docheck)(struct fstab *),
d->d_pid = 0;
nrun--;
- if (TAILQ_FIRST(&d->d_part) == NULL)
+ if (TAILQ_EMPTY(&d->d_part))
ndisks--;
if (nextdisk == NULL) {
- if (TAILQ_FIRST(&d->d_part)) {
+ if (!TAILQ_EMPTY(&d->d_part)) {
if ((ret = startdisk(d, checkit)) != 0)
return ret;
}
@@ -211,8 +211,8 @@ checkfstab(int flags, int maxrun, void *(*docheck)(struct fstab *),
d_entries);
if (nextdisk == NULL)
nextdisk = TAILQ_FIRST(&diskh);
- if (TAILQ_FIRST(&nextdisk->d_part) !=
- NULL && nextdisk->d_pid == 0)
+ if (!TAILQ_EMPTY(&nextdisk->d_part) &&
+ nextdisk->d_pid == 0)
break;
}
if ((ret = startdisk(nextdisk, checkit)) != 0)