From: lteo Date: Fri, 10 Jan 2014 18:51:05 +0000 (+0000) Subject: When using a checklist, print MISSING for non-existent files. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f25975336c748912a2ab5ccef813e66dd426dbdd;p=openbsd When using a checklist, print MISSING for non-existent files. Based on an earlier diff by tedu@ Requested by deraadt@ OK deraadt@ --- 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 #include #include +#include #include #include @@ -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; }