From: Ian Darwin Date: Fri, 11 Sep 1992 12:37:43 +0000 (+0000) Subject: Fix long-standing bug that fn and "no such file or directory" came out X-Git-Tag: FILE3_27~222 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a2cc4f2e5c6bea25420aaac7257379713f0ca18;p=file Fix long-standing bug that fn and "no such file or directory" came out on seperate lines, by using new ckfprintf. This msg is no longer fatal, too. --- diff --git a/src/fsmagic.c b/src/fsmagic.c index 5bf050de..4ce2eb35 100644 --- a/src/fsmagic.c +++ b/src/fsmagic.c @@ -46,7 +46,7 @@ #ifndef lint static char *moduleid = - "@(#)$Id: fsmagic.c,v 1.18 1992/09/11 12:07:27 ian Exp $"; + "@(#)$Id: fsmagic.c,v 1.19 1992/09/11 12:37:43 ian Exp $"; #endif /* lint */ int @@ -65,11 +65,14 @@ struct stat *sb; ret = lstat(fn, sb); else #endif - ret = stat(fn, sb); + ret = stat(fn, sb); /* don't merge into if; see "ret =" above */ if (ret) { - error("can't stat `%s' (%s).\n", fn, strerror(errno)); - /*NOTREACHED*/ + ckfprintf(stdout, + /* Yes, I do mean stdout. */ + /* No \n, caller will provide. */ + "can't stat `%s' (%s).", fn, strerror(errno)); + return 1; } if (sb->st_mode & S_ISUID) ckfputs("setuid ", stdout);