use err/warn(3) from C library
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 30 Apr 1993 03:39:44 +0000 (19:39 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 30 Apr 1993 03:39:44 +0000 (19:39 -0800)
SCCS-vsn: bin/ls/util.c 5.13

usr/src/bin/ls/util.c

index 6dfc90b..4542821 100644 (file)
@@ -9,17 +9,18 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)util.c     5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)util.c     5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
+
 #include <ctype.h>
 #include <fts.h>
 #include <ctype.h>
 #include <fts.h>
-#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <string.h>
+
 #include "ls.h"
 #include "extern.h"
 
 #include "ls.h"
 #include "extern.h"
 
@@ -42,33 +43,3 @@ usage()
        (void)fprintf(stderr, "usage: ls [-1ACFLRTacdfiklqrstu] [file ...]\n");
        exit(1);
 }
        (void)fprintf(stderr, "usage: ls [-1ACFLRTacdfiklqrstu] [file ...]\n");
        exit(1);
 }
-
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-void
-#if __STDC__
-err(int fatal, const char *fmt, ...)
-#else
-err(fatal, fmt, va_alist)
-       int fatal;
-       char *fmt;
-       va_dcl
-#endif
-{
-       va_list ap;
-#if __STDC__
-       va_start(ap, fmt);
-#else
-       va_start(ap);
-#endif
-       (void)fprintf(stderr, "ls: ");
-       (void)vfprintf(stderr, fmt, ap);
-       va_end(ap);
-       (void)fprintf(stderr, "\n");
-       if (fatal)
-               exit(1);
-}