Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libutil - __RCSID() police.



details:   https://anonhg.NetBSD.org/src/rev/32bee5b30040
branches:  trunk
changeset: 494300:32bee5b30040
user:      ad <ad%NetBSD.org@localhost>
date:      Wed Jul 05 11:46:40 2000 +0000

description:
- __RCSID() police.
- ANSIfy.
- Miscellaneous style changes.
- Shutup lint(1) in one or two cases.

diffstat:

 lib/libutil/fparseln.c         |   23 ++------
 lib/libutil/getmaxpartitions.c |    6 +-
 lib/libutil/login.c            |    7 +-
 lib/libutil/login_cap.c        |  107 ++++++++++++----------------------------
 lib/libutil/login_tty.c        |    7 +-
 lib/libutil/logout.c           |    7 +-
 lib/libutil/logwtmp.c          |    7 +-
 lib/libutil/opendisk.c         |   12 +---
 lib/libutil/pidfile.c          |   11 +--
 lib/libutil/pidlock.c          |   18 +----
 lib/libutil/pty.c              |   17 +----
 lib/libutil/securepath.c       |    8 ++-
 lib/libutil/ttyaction.c        |   12 ++-
 lib/libutil/ttymsg.c           |   10 +--
 14 files changed, 89 insertions(+), 163 deletions(-)

diffs (truncated from 710 to 300 lines):

diff -r 0b99c962d93d -r 32bee5b30040 lib/libutil/fparseln.c
--- a/lib/libutil/fparseln.c    Wed Jul 05 11:44:01 2000 +0000
+++ b/lib/libutil/fparseln.c    Wed Jul 05 11:46:40 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fparseln.c,v 1.9 1999/09/20 04:48:06 lukem Exp $       */
+/*     $NetBSD: fparseln.c,v 1.10 2000/07/05 11:46:40 ad 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.9 1999/09/20 04:48:06 lukem Exp $");
+__RCSID("$NetBSD: fparseln.c,v 1.10 2000/07/05 11:46:40 ad Exp $");
 #endif
 
 #include <assert.h>
@@ -41,16 +41,14 @@
 #include <stdlib.h>
 #include <util.h>
 
-static int isescaped __P((const char *, const char *, int));
+static int isescaped(const char *, const char *, int);
 
 /* isescaped():
  *     Return true if the character in *p that belongs to a string
  *     that starts in *sp, is escaped by the escape character esc.
  */
 static int
-isescaped(sp, p, esc)
-       const char *sp, *p;
-       int esc;
+isescaped(const char *sp, const char *p, int esc)
 {
        const char     *cp;
        size_t          ne;
@@ -77,12 +75,7 @@
  *     the comment char.
  */
 char *
-fparseln(fp, size, lineno, str, flags)
-       FILE            *fp;
-       size_t          *size;
-       size_t          *lineno;
-       const char       str[3];
-       int              flags;
+fparseln(FILE *fp, size_t *size, size_t *lineno, const char str[3], int flags)
 {
        static const char dstr[3] = { '\\', '\\', '#' };
 
@@ -196,12 +189,10 @@
 
 #ifdef TEST
 
-int main __P((int, char **));
+int main(int, char **);
 
 int
-main(argc, argv)
-       int argc;
-       char **argv;
+main(int argc, char **argv)
 {
        char   *ptr;
        size_t  size, line;
diff -r 0b99c962d93d -r 32bee5b30040 lib/libutil/getmaxpartitions.c
--- a/lib/libutil/getmaxpartitions.c    Wed Jul 05 11:44:01 2000 +0000
+++ b/lib/libutil/getmaxpartitions.c    Wed Jul 05 11:46:40 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getmaxpartitions.c,v 1.3 1997/07/31 00:01:18 jtc Exp $ */
+/*     $NetBSD: getmaxpartitions.c,v 1.4 2000/07/05 11:46:40 ad Exp $  */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getmaxpartitions.c,v 1.3 1997/07/31 00:01:18 jtc Exp $");
+__RCSID("$NetBSD: getmaxpartitions.c,v 1.4 2000/07/05 11:46:40 ad Exp $");
 #endif
 
 #include <sys/param.h>
@@ -46,7 +46,7 @@
 #include <util.h>
 
 int
-getmaxpartitions()
+getmaxpartitions(void)
 {
        int maxpart, mib[2];
        size_t varlen;
diff -r 0b99c962d93d -r 32bee5b30040 lib/libutil/login.c
--- a/lib/libutil/login.c       Wed Jul 05 11:44:01 2000 +0000
+++ b/lib/libutil/login.c       Wed Jul 05 11:46:40 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: login.c,v 1.12 1999/09/20 04:48:06 lukem Exp $ */
+/*     $NetBSD: login.c,v 1.13 2000/07/05 11:46:40 ad 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.12 1999/09/20 04:48:06 lukem Exp $");
+__RCSID("$NetBSD: login.c,v 1.13 2000/07/05 11:46:40 ad Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -54,8 +54,7 @@
 #include <utmp.h>
 
 void
-login(ut)
-       const struct utmp *ut;
+login(const struct utmp *ut)
 {
        int fd;
        int tty;
diff -r 0b99c962d93d -r 32bee5b30040 lib/libutil/login_cap.c
--- a/lib/libutil/login_cap.c   Wed Jul 05 11:44:01 2000 +0000
+++ b/lib/libutil/login_cap.c   Wed Jul 05 11:46:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: login_cap.c,v 1.5 2000/02/10 20:52:54 mjl Exp $ */
+/*     $NetBSD: login_cap.c,v 1.6 2000/07/05 11:46:41 ad Exp $ */
 
 /*-
  * Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved.
@@ -33,6 +33,11 @@
  *
  *     BSDI login_cap.c,v 2.13 1998/02/07 03:17:05 prb Exp
  */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: login_cap.c,v 1.6 2000/07/05 11:46:41 ad Exp $");
+#endif /* LIBC_SCCS and not lint */
  
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -53,19 +58,18 @@
 #include <syslog.h>
 #include <unistd.h>
 
+static char    *classfiles[] = { _PATH_LOGIN_CONF, 0 };
 
-static char *classfiles[] = { _PATH_LOGIN_CONF, 0 };
-static void setuserpath __P((login_cap_t *, char *));
-static u_quad_t multiply __P((u_quad_t, u_quad_t));
-static u_quad_t strtolimit __P((char *, char **, int));
-static u_quad_t strtosize __P((char *, char **, int));
-static int gsetrl __P((login_cap_t *, int, char *, int type));
-static int setuserenv __P((login_cap_t *));
-static int isinfinite __P((const char *));
+static void    setuserpath(login_cap_t *, char *);
+static u_quad_t        multiply(u_quad_t, u_quad_t);
+static u_quad_t        strtolimit(char *, char **, int);
+static u_quad_t        strtosize(char *, char **, int);
+static int     gsetrl(login_cap_t *, int, char *, int type);
+static int     setuserenv(login_cap_t *);
+static int     isinfinite(const char *);
 
 login_cap_t *
-login_getclass(class)
-       char *class;
+login_getclass(char *class)
 {
        login_cap_t *lc;
        int res;
@@ -127,18 +131,13 @@
 }
 
 login_cap_t *
-login_getpwclass(pwd)
-       const struct passwd *pwd;
+login_getpwclass(const struct passwd *pwd)
 {
        return login_getclass(pwd ? pwd->pw_class : NULL);
 }
 
 char *
-login_getcapstr(lc, cap, def, e)
-       login_cap_t *lc;
-       char *cap;
-       char *def;
-       char *e;
+login_getcapstr(login_cap_t *lc, char *cap, char *def, char *e)
 {
        char *res;
        int status;
@@ -165,11 +164,7 @@
 }
 
 quad_t
-login_getcaptime(lc, cap, def, e)
-       login_cap_t *lc;
-       char *cap;
-       quad_t def;
-       quad_t e;
+login_getcaptime(login_cap_t *lc, char *cap, quad_t def, quad_t e)
 {
        char *ep;
        char *res, *sres;
@@ -245,11 +240,7 @@
 }
 
 quad_t
-login_getcapnum(lc, cap, def, e)
-       login_cap_t *lc;
-       char *cap;
-       quad_t def;
-       quad_t e;
+login_getcapnum(login_cap_t *lc, char *cap, quad_t def, quad_t e)
 {
        char *ep;
        char *res;
@@ -293,11 +284,7 @@
 }
 
 quad_t
-login_getcapsize(lc, cap, def, e)
-       login_cap_t *lc;
-       char *cap;
-       quad_t def;
-       quad_t e;
+login_getcapsize(login_cap_t *lc, char *cap, quad_t def, quad_t e)
 {
        char *ep;
        char *res;
@@ -339,10 +326,7 @@
 }
 
 int
-login_getcapbool(lc, cap, def)
-       login_cap_t *lc;
-       char *cap;
-       u_int def;
+login_getcapbool(login_cap_t *lc, char *cap, u_int def)
 {
        if (!lc || !lc->lc_cap)
                return (def);
@@ -351,8 +335,7 @@
 }
 
 void
-login_close(lc)
-       login_cap_t *lc;
+login_close(login_cap_t *lc)
 {
        if (lc) {
                if (lc->lc_class)
@@ -387,11 +370,7 @@
 };
 
 static int
-gsetrl(lc, what, name, type)
-       login_cap_t *lc;
-       int what;
-       char *name;
-       int type;
+gsetrl(login_cap_t *lc, int what, char *name, int type)
 {
        struct rlimit rl;
        struct rlimit r;
@@ -443,8 +422,7 @@
 }
 
 static int
-setuserenv(lc)
-       login_cap_t *lc;
+setuserenv(login_cap_t *lc)
 {
        char *stop = ", \t";
        int i, count;
@@ -484,7 +462,7 @@
 
        for (i = 0; i < count && res[i]; i++) {
                if (*res[i] != '\0') {
-                       if ((ptr = strchr(res[i], '=')))
+                       if ((ptr = strchr(res[i], '=')) != NULL)
                                *ptr++ = '\0';
                        else 
                                ptr = "";
@@ -496,11 +474,8 @@
        return 0;
 }
 
-
 int
-setclasscontext(class, flags)
-       char *class;
-       u_int flags;
+setclasscontext(char *class, u_int flags)
 {
        int ret;
        login_cap_t *lc;
@@ -515,11 +490,7 @@
 }



Home | Main Index | Thread Index | Old Index