summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlteo <lteo@openbsd.org>2014-01-10 18:51:05 +0000
committerlteo <lteo@openbsd.org>2014-01-10 18:51:05 +0000
commitf25975336c748912a2ab5ccef813e66dd426dbdd (patch)
tree2ac2b8ae3a100d99d620dc5ab005e179e468e2d4
parentsort options (diff)
downloadwireguard-openbsd-f25975336c748912a2ab5ccef813e66dd426dbdd.tar.xz
wireguard-openbsd-f25975336c748912a2ab5ccef813e66dd426dbdd.zip
When using a checklist, print MISSING for non-existent files.
Based on an earlier diff by tedu@ Requested by deraadt@ OK deraadt@
-rw-r--r--bin/md5/md5.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/md5/md5.c b/bin/md5/md5.c
index cf197361253..5fc9e5ed9de 100644
--- a/bin/md5/md5.c
+++ b/bin/md5/md5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: md5.c,v 1.65 2014/01/10 05:34:46 tedu Exp $ */
+/* $OpenBSD: md5.c,v 1.66 2014/01/10 18:51:05 lteo Exp $ */
/*
* Copyright (c) 2001,2003,2005-2007,2010,2013,2014
@@ -34,6 +34,7 @@
#include <limits.h>
#include <time.h>
#include <unistd.h>
+#include <errno.h>
#include <md4.h>
#include <md5.h>
@@ -682,7 +683,8 @@ digest_filelist(const char *file, struct hash_function *defhash)
if ((fp = fopen(filename, "r")) == NULL) {
warn("cannot open %s", filename);
- (void)printf("(%s) %s: FAILED\n", algorithm, filename);
+ (void)printf("(%s) %s: %s\n", algorithm, filename,
+ (errno == ENOENT ? "MISSING" : "FAILED"));
error = 1;
continue;
}