summaryrefslogtreecommitdiffstats
path: root/libexec/makekey/makekey.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/makekey/makekey.c')
-rw-r--r--libexec/makekey/makekey.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/libexec/makekey/makekey.c b/libexec/makekey/makekey.c
index 1a2e149..d786bc9 100644
--- a/libexec/makekey/makekey.c
+++ b/libexec/makekey/makekey.c
@@ -1,6 +1,6 @@
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 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
@@ -32,23 +32,27 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1990 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1990, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)makekey.c 5.3 (Berkeley) 2/25/91";
+static char sccsid[] = "@(#)makekey.c 8.1 (Berkeley) 6/4/93";
#endif /* not lint */
+#include <sys/types.h>
+
+#include <err.h>
#include <errno.h>
-#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
-static void error(), get();
+static void get __P((char *, int));
+int
main()
{
int len;
@@ -58,7 +62,7 @@ main()
get(salt, sizeof(salt) - 1);
len = strlen(r = crypt(key, salt));
if (write(STDOUT_FILENO, r, len) != len)
- error();
+ err(1, "stdout");
exit(0);
}
@@ -74,12 +78,5 @@ get(bp, len)
return;
if (nr >= 0)
errno = EFTYPE;
- error();
-}
-
-static void
-error()
-{
- (void)fprintf(stderr, "makekey: %s\n", strerror(errno));
- exit(1);
+ err(1, "stdin");
}
OpenPOWER on IntegriCloud