diff options
| author | lukem <lukem@NetBSD.org> | 1999-09-20 04:38:56 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 1999-09-20 04:38:56 +0000 |
| commit | d896261208b4610b0c4e86ea95caad3cdc86a4ac (patch) | |
| tree | 9a96db945c9ffba191e3aa4d741cf5d30fbd30f2 /lib/libutil | |
| parent | f6ae64deff8e64a1acb3e1536bf6b6d06f7bffb9 (diff) | |
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
Diffstat (limited to 'lib/libutil')
| -rw-r--r-- | lib/libutil/fparseln.c | 14 | ||||
| -rw-r--r-- | lib/libutil/login.c | 8 | ||||
| -rw-r--r-- | lib/libutil/login_tty.c | 10 | ||||
| -rw-r--r-- | lib/libutil/logout.c | 8 | ||||
| -rw-r--r-- | lib/libutil/logwtmp.c | 8 | ||||
| -rw-r--r-- | lib/libutil/opendisk.c | 10 | ||||
| -rw-r--r-- | lib/libutil/passwd.c | 8 | ||||
| -rw-r--r-- | lib/libutil/pidlock.c | 22 | ||||
| -rw-r--r-- | lib/libutil/pty.c | 16 | ||||
| -rw-r--r-- | lib/libutil/ttyaction.c | 6 | ||||
| -rw-r--r-- | lib/libutil/ttymsg.c | 12 |
11 files changed, 21 insertions, 101 deletions
diff --git a/lib/libutil/fparseln.c b/lib/libutil/fparseln.c index e8fe584f584..cd4d3ddf3d1 100644 --- a/lib/libutil/fparseln.c +++ b/lib/libutil/fparseln.c @@ -1,4 +1,4 @@ -/* $NetBSD: fparseln.c,v 1.8 1999/09/16 11:45:50 lukem Exp $ */ +/* $NetBSD: fparseln.c,v 1.9 1999/09/20 04:48:06 lukem Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: fparseln.c,v 1.8 1999/09/16 11:45:50 lukem Exp $"); +__RCSID("$NetBSD: fparseln.c,v 1.9 1999/09/20 04:48:06 lukem Exp $"); #endif #include <assert.h> @@ -57,10 +57,6 @@ isescaped(sp, p, esc) _DIAGASSERT(sp != NULL); _DIAGASSERT(p != NULL); -#ifdef _DIAGNOSTIC - if (sp == NULL || p == NULL) - return 0; -#endif /* No escape character */ if (esc == '\0') @@ -97,12 +93,6 @@ fparseln(fp, size, lineno, str, flags) char esc, con, nl, com; _DIAGASSERT(fp != NULL); -#ifdef _DIAGNOSTIC - if (fp == NULL) { - errno = EBADF; - return NULL; - } -#endif len = 0; buf = NULL; diff --git a/lib/libutil/login.c b/lib/libutil/login.c index 62808e5f68f..47ca76025bd 100644 --- a/lib/libutil/login.c +++ b/lib/libutil/login.c @@ -1,4 +1,4 @@ -/* $NetBSD: login.c,v 1.11 1999/09/16 11:45:50 lukem Exp $ */ +/* $NetBSD: login.c,v 1.12 1999/09/20 04:48:06 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)login.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: login.c,v 1.11 1999/09/16 11:45:50 lukem Exp $"); +__RCSID("$NetBSD: login.c,v 1.12 1999/09/20 04:48:06 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -61,10 +61,6 @@ login(ut) int tty; _DIAGASSERT(ut != NULL); -#ifdef _DIAGNOSTIC - if (ut == NULL) - return; -#endif tty = ttyslot(); if (tty > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) { diff --git a/lib/libutil/login_tty.c b/lib/libutil/login_tty.c index be0d66a5829..d30e0785173 100644 --- a/lib/libutil/login_tty.c +++ b/lib/libutil/login_tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: login_tty.c,v 1.8 1999/09/16 11:45:50 lukem Exp $ */ +/* $NetBSD: login_tty.c,v 1.9 1999/09/20 04:48:07 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)login_tty.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: login_tty.c,v 1.8 1999/09/16 11:45:50 lukem Exp $"); +__RCSID("$NetBSD: login_tty.c,v 1.9 1999/09/20 04:48:07 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -56,12 +56,6 @@ login_tty(fd) { _DIAGASSERT(fd != -1); -#ifdef _DIAGNOSTIC - if (fd == -1) { - errno = EBADF; - return (-1); - } -#endif (void) setsid(); if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1) diff --git a/lib/libutil/logout.c b/lib/libutil/logout.c index f0bf520e108..198564789b0 100644 --- a/lib/libutil/logout.c +++ b/lib/libutil/logout.c @@ -1,4 +1,4 @@ -/* $NetBSD: logout.c,v 1.10 1999/09/16 11:45:50 lukem Exp $ */ +/* $NetBSD: logout.c,v 1.11 1999/09/20 04:48:07 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)logout.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: logout.c,v 1.10 1999/09/16 11:45:50 lukem Exp $"); +__RCSID("$NetBSD: logout.c,v 1.11 1999/09/20 04:48:07 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -64,10 +64,6 @@ logout(line) UTMP ut; _DIAGASSERT(line != NULL); -#ifdef _DIAGNOSTIC - if (line == NULL) - return(0); -#endif if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0) return(0); diff --git a/lib/libutil/logwtmp.c b/lib/libutil/logwtmp.c index 2049087de4f..f1e68ba1170 100644 --- a/lib/libutil/logwtmp.c +++ b/lib/libutil/logwtmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: logwtmp.c,v 1.9 1999/09/16 11:45:51 lukem Exp $ */ +/* $NetBSD: logwtmp.c,v 1.10 1999/09/20 04:48:07 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: logwtmp.c,v 1.9 1999/09/16 11:45:51 lukem Exp $"); +__RCSID("$NetBSD: logwtmp.c,v 1.10 1999/09/20 04:48:07 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -65,10 +65,6 @@ logwtmp(line, name, host) _DIAGASSERT(line != NULL); _DIAGASSERT(name != NULL); _DIAGASSERT(host != NULL); -#ifdef _DIAGNOSTIC - if (line == NULL || name == NULL || host == NULL) - return; -#endif if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0) return; diff --git a/lib/libutil/opendisk.c b/lib/libutil/opendisk.c index 52b2c0cbf52..b72247d07f7 100644 --- a/lib/libutil/opendisk.c +++ b/lib/libutil/opendisk.c @@ -1,4 +1,4 @@ -/* $NetBSD: opendisk.c,v 1.5 1999/09/16 11:45:51 lukem Exp $ */ +/* $NetBSD: opendisk.c,v 1.6 1999/09/20 04:48:07 lukem Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: opendisk.c,v 1.5 1999/09/16 11:45:51 lukem Exp $"); +__RCSID("$NetBSD: opendisk.c,v 1.6 1999/09/20 04:48:07 lukem Exp $"); #endif #include <sys/param.h> @@ -61,12 +61,6 @@ opendisk(path, flags, buf, buflen, iscooked) { int f, rawpart; -#ifdef _DIAGNOSTIC - if (path == NULL || *path == '\0') { - errno = ENOENT; - return (-1); - } -#endif if (buf == NULL) { errno = EFAULT; diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c index 659e57ea63d..3d92e996eb7 100644 --- a/lib/libutil/passwd.c +++ b/lib/libutil/passwd.c @@ -1,4 +1,4 @@ -/* $NetBSD: passwd.c,v 1.17 1999/09/17 01:28:12 lukem Exp $ */ +/* $NetBSD: passwd.c,v 1.18 1999/09/20 04:48:11 lukem Exp $ */ /* * Copyright (c) 1987, 1993, 1994, 1995 @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: passwd.c,v 1.17 1999/09/17 01:28:12 lukem Exp $"); +__RCSID("$NetBSD: passwd.c,v 1.18 1999/09/20 04:48:11 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -282,10 +282,6 @@ pw_copy(ffd, tfd, pw, old_pw) _DIAGASSERT(pw != NULL); /* old_pw may be NULL */ -#ifdef _DIAGNOSTIC - if (pw == NULL) - return; -#endif if (!(from = fdopen(ffd, "r"))) pw_error(_PATH_MASTERPASSWD, 1, 1); diff --git a/lib/libutil/pidlock.c b/lib/libutil/pidlock.c index 85b644d6165..394b9635c55 100644 --- a/lib/libutil/pidlock.c +++ b/lib/libutil/pidlock.c @@ -1,4 +1,4 @@ -/* $NetBSD: pidlock.c,v 1.7 1999/09/16 11:45:51 lukem Exp $ */ +/* $NetBSD: pidlock.c,v 1.8 1999/09/20 04:48:08 lukem Exp $ */ /* * Copyright 1996, 1997 by Curt Sampson <cjs@netbsd.org>. @@ -24,7 +24,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: pidlock.c,v 1.7 1999/09/16 11:45:51 lukem Exp $"); +__RCSID("$NetBSD: pidlock.c,v 1.8 1999/09/20 04:48:08 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -63,12 +63,6 @@ pidlock(lockfile, flags, locker, info) _DIAGASSERT(lockfile != NULL); /* locker may be NULL */ /* info may be NULL */ -#ifdef _DIAGNOSTIC - if (lockfile == NULL) { - errno = EFAULT; - return -1; - } -#endif if (gethostname(hostname, sizeof(hostname))) @@ -212,12 +206,6 @@ ttylock(tty, flags, locker) _DIAGASSERT(tty != NULL); /* locker is not used */ -#ifdef _DIAGNOSTIC - if (tty == NULL || *tty == '\0') { - errno = ENOENT; - return -1; - } -#endif /* make sure the tty exists */ strcpy(ttyfile, DEVPATH); @@ -244,12 +232,6 @@ ttyunlock(tty) struct stat sb; _DIAGASSERT(tty != NULL); -#ifdef _DIAGNOSTIC - if (tty == NULL || *tty == '\0') { - errno = ENOENT; - return -1; - } -#endif /* make sure the tty exists */ strcpy(ttyfile, DEVPATH); diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c index 3b82296f55b..8d83e6946d9 100644 --- a/lib/libutil/pty.c +++ b/lib/libutil/pty.c @@ -1,4 +1,4 @@ -/* $NetBSD: pty.c,v 1.13 1999/09/16 11:45:51 lukem Exp $ */ +/* $NetBSD: pty.c,v 1.14 1999/09/20 04:48:08 lukem Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)pty.c 8.3 (Berkeley) 5/16/94"; #else -__RCSID("$NetBSD: pty.c,v 1.13 1999/09/16 11:45:51 lukem Exp $"); +__RCSID("$NetBSD: pty.c,v 1.14 1999/09/20 04:48:08 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -81,12 +81,6 @@ openpty(amaster, aslave, name, termp, winp) /* name may be NULL */ /* termp may be NULL */ /* winp may be NULL */ -#ifdef _DIAGNOSTIC - if (amaster == NULL || aslave == NULL) { - errno = EFAULT; - return (-1); - } -#endif if ((gr = getgrnam("tty")) != NULL) ttygid = gr->gr_gid; @@ -141,12 +135,6 @@ forkpty(amaster, name, termp, winp) /* name may be NULL */ /* termp may be NULL */ /* winp may be NULL */ -#ifdef _DIAGNOSTIC - if (amaster == NULL) { - errno = EFAULT; - return (-1); - } -#endif if (openpty(&master, &slave, name, termp, winp) == -1) return (-1); diff --git a/lib/libutil/ttyaction.c b/lib/libutil/ttyaction.c index 466e815db0f..cd1ff6c1128 100644 --- a/lib/libutil/ttyaction.c +++ b/lib/libutil/ttyaction.c @@ -1,4 +1,4 @@ -/* $NetBSD: ttyaction.c,v 1.12 1999/09/16 11:45:51 lukem Exp $ */ +/* $NetBSD: ttyaction.c,v 1.13 1999/09/20 04:48:10 lukem Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -84,10 +84,6 @@ ttyaction(tty, act, user) _DIAGASSERT(tty != NULL); _DIAGASSERT(act != NULL); _DIAGASSERT(user != NULL); -#ifdef _DIAGNOSTIC - if (tty == NULL || act == NULL || user == NULL) - return 0; -#endif fp = fopen(actfile, "r"); if (fp == NULL) diff --git a/lib/libutil/ttymsg.c b/lib/libutil/ttymsg.c index 3cf87a51167..cc50fb51ac6 100644 --- a/lib/libutil/ttymsg.c +++ b/lib/libutil/ttymsg.c @@ -1,4 +1,4 @@ -/* $NetBSD: ttymsg.c,v 1.13 1999/09/16 11:45:51 lukem Exp $ */ +/* $NetBSD: ttymsg.c,v 1.14 1999/09/20 04:48:11 lukem Exp $ */ /* * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)ttymsg.c 8.2 (Berkeley) 11/16/93"; #else -__RCSID("$NetBSD: ttymsg.c,v 1.13 1999/09/16 11:45:51 lukem Exp $"); +__RCSID("$NetBSD: ttymsg.c,v 1.14 1999/09/20 04:48:11 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -81,14 +81,6 @@ ttymsg(iov, iovcnt, line, tmout) _DIAGASSERT(iov != NULL); _DIAGASSERT(iovcnt >= 0); _DIAGASSERT(line != NULL); -#ifdef _DIAGNOSTIC - if (iov == NULL) - return ("ttymsg(3) called with iov == NULL"); - if (iovcnt < 0) - return ("ttymsg(3) called with iovcnt < 0"); - if (line == NULL) - return ("ttymsg(3) called with line == NULL"); -#endif if (iovcnt > sizeof(localiov) / sizeof(localiov[0])) return ("too many iov's (change code in libutil/ttymsg.c)"); |
