rewritten from manual page; add Berkeley specific header
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 1 Jul 1988 02:46:58 +0000 (18:46 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 1 Jul 1988 02:46:58 +0000 (18:46 -0800)
SCCS-vsn: usr.sbin/accton/accton.c 4.2

usr/src/usr.sbin/accton/accton.c

index a72dab1..ec5e3f8 100644 (file)
@@ -1,13 +1,41 @@
-static char *sccsid = "@(#)accton.c    4.1 (Berkeley) %G%";
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1988 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+#ifndef lint
+static char sccsid[] = "@(#)accton.c   4.2 (Berkeley) %G%";
+#endif /* not lint */
+
+#include <stdio.h>
+
 main(argc, argv)
 main(argc, argv)
-char **argv;
+       int argc;
+       char **argv;
 {
 {
-       extern errno;
-       if (argc > 1)
-               acct(argv[1]);
-       else
-               acct((char *)0);
-       if (errno) {
+       if (argc > 2) {
+               fputs("usage: accton [file]\n", stderr);
+               exit(1);
+       }
+       if (acct(argc == 2 ? argv[1] : (char *)NULL)) {
                perror("accton");
                exit(1);
        }
                perror("accton");
                exit(1);
        }