SCCS-vsn: usr.bin/file/file.c 4.5
-static char sccsid[] = "@(#)file.c 4.4 (Berkeley) 4.4";
+static char sccsid[] = "@(#)file.c 4.5 (Berkeley) 4.5";
/*
* file - determine type of file
*/
/*
* file - determine type of file
*/
#include <stdio.h>
#include <ctype.h>
#include <a.out.h>
#include <stdio.h>
#include <ctype.h>
#include <a.out.h>
+int errno;
+char *sys_errlist[];
int in;
int i = 0;
char buf[BUFSIZ];
int in;
int i = 0;
char buf[BUFSIZ];
if (argc>1 && argv[1][0]=='-' && argv[1][1]=='f') {
if ((fl = fopen(argv[2], "r")) == NULL) {
if (argc>1 && argv[1][0]=='-' && argv[1][1]=='f') {
if ((fl = fopen(argv[2], "r")) == NULL) {
- printf("Can't open %s\n", argv[2]);
exit(2);
}
while ((p = fgets(ap, 128, fl)) != NULL) {
exit(2);
}
while ((p = fgets(ap, 128, fl)) != NULL) {
ifile = -1;
if (lstat(file, &mbuf) < 0) {
ifile = -1;
if (lstat(file, &mbuf) < 0) {
- printf("cannot stat\n");
+ printf("%s\n", sys_errlist[errno]);
return;
}
switch (mbuf.st_mode & S_IFMT) {
return;
}
switch (mbuf.st_mode & S_IFMT) {