diff options
author | Lawrence Teo <lteo@cvs.openbsd.org> | 2014-01-10 18:51:06 +0000 |
---|---|---|
committer | Lawrence Teo <lteo@cvs.openbsd.org> | 2014-01-10 18:51:06 +0000 |
commit | 2190227229d6631a00a0082dfa93ea49396ba075 (patch) | |
tree | ea4f4f9c6476510beecf9939cf4237c90db650d5 /bin | |
parent | 15f9a36dcd33f3b8739f20f72a16667359bd936a (diff) |
When using a checklist, print MISSING for non-existent files.
Based on an earlier diff by tedu@
Requested by deraadt@
OK deraadt@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/md5/md5.c | 6 |
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; } |