If some files lost in /var/db/pkg/<port>/ after system crash f.e.,

pkg_manage silently dumps core, pkg_info claims about them to
stderr, which makes very difficult to find what directory cause it via
tons of pkg_info -a output. I found solution which covers both variants,
now pkg_info claims about missing files to stdout among valid output
with ERROR: prefix. It heals pkg_manage to not dump core and makes
easy to find errors in pkg_info -a output by simple /ERROR 'more' command.
This commit is contained in:
ache 1995-07-30 01:08:34 +00:00
parent ef105bb7c7
commit 187d46fc1a

View File

@ -1,5 +1,5 @@
#ifndef lint
static const char *rcsid = "$Id: show.c,v 1.5 1995/01/05 01:10:13 swallace Exp $";
static const char *rcsid = "$Id: show.c,v 1.6 1995/05/30 03:50:02 rgrimes Exp $";
#endif
/*
@ -35,13 +35,13 @@ show_file(char *title, char *fname)
if (!Quiet)
printf("%s%s", InfoPrefix, title);
fp = fopen(fname, "r");
if (!fp) {
whinge("show_file: Can't open '%s' for reading.", fname);
return;
if (!fp)
printf("ERROR: show_file: Can't open '%s' for reading!\n", fname);
else {
while (n = fread(line, 1, 1024, fp))
fwrite(line, 1, n, stdout);
fclose(fp);
}
while (n = fread(line, 1, 1024, fp))
fwrite(line, 1, n, stdout);
fclose(fp);
printf("\n"); /* just in case */
}