On Fri, 08 Apr 2011 11:23:44 +0200, Stuart Henderson wrote: > would anyone else find this (or a variation thereof) useful? > > example use: if you download a partial snapshot and would like to > check files, this makes it easy to identify whether a file actually > fails the checksum, or whether you just don't have it. > > Index: md5.c > =================================================================== > RCS file: /cvs/src/bin/md5/md5.c,v > retrieving revision 1.52 > diff -u -p -r1.52 md5.c > --- md5.c 27 Oct 2010 15:24:10 -0000 1.52 > +++ md5.c 8 Apr 2011 09:17:29 -0000 > @@ -655,7 +655,7 @@ digest_filelist(const char *file, struct > > if ((fp = fopen(filename, "r")) == NULL) { > warn("cannot open %s", filename); > - (void)printf("(%s) %s: FAILED\n", algorithm, filename); > + (void)printf("(%s) %s: MISSING\n", algorithm, filename); > error = 1; > continue; > }
Two messages are printed for the very same error. Would it make sense to remove the printf() message altogether or, alternatively, integrate it into the warn() message (e.g. warn("(%s) %s: FAILED", algorithm, filename))?