BSD 4_4 release
[unix-history] / usr / src / libexec / lfs_cleanerd / misc.c
index 7ae725c..ad6e11a 100644 (file)
@@ -1,6 +1,6 @@
 /*-
 /*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1992, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.1 (Berkeley) 9/19/91";
+static char sccsid[] = "@(#)misc.c     8.1 (Berkeley) 6/4/93";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
+
 #include <unistd.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+
 extern char *special;
 extern char *special;
+
 #if __STDC__
 #include <stdarg.h>
 #else
 #if __STDC__
 #include <stdarg.h>
 #else
@@ -66,7 +69,9 @@ err(fmt, va_alist)
        (void)fprintf(stderr, "%s: ", special);
        (void)vfprintf(stderr, fmt, ap);
        va_end(ap);
        (void)fprintf(stderr, "%s: ", special);
        (void)vfprintf(stderr, fmt, ap);
        va_end(ap);
-       (void)fprintf(stderr, " %s\n", strerror(errno));
+       if (errno)
+               (void)fprintf(stderr, " %s", strerror(errno));
+       (void)fprintf(stderr, "\n");
        if (fatal)
                exit(1);
 }
        if (fatal)
                exit(1);
 }
@@ -87,4 +92,3 @@ get(fd, off, p, len)
        if (rbytes != len)
                err(1, "%s: short read (%d, not %d)", special, rbytes, len);
 }
        if (rbytes != len)
                err(1, "%s: short read (%d, not %d)", special, rbytes, len);
 }
-