diff -ru a/crossapi.cpp b/crossapi.cpp --- a/crossapi.cpp 2009-06-26 00:14:03.000000000 +0400 +++ b/crossapi.cpp 2022-09-15 01:20:27.974989505 +0300 @@ -200,7 +200,13 @@ int CrossAPI_FindFirstFile(char *szFileName,CROSSAPI_FIND_DATA *cfd) { struct stat inode; - stat(szFileName,&inode); + int rc = stat(szFileName,&inode); + if(rc<0) { + int e = errno; + char buff[1000]; + fprintf(stderr, "Can't stat file \"%s\": %s\n", szFileName, strerror_r(e, buff, sizeof(buff))); + return -1; + } strncpy(cfd->cFileName,szFileName,CROSSAPI_MAX_PATH); if(inode.st_mode&S_IFDIR) cfd->bIsDirectory=true; else cfd->bIsDirectory=false; @@ -325,6 +331,9 @@ hFile=open(filename,O_RDONLY); if(hFile==-1) { + int e = errno; + char buff[1000]; + fprintf(stderr, "Can't open file \"%s\": %s\n", filename, strerror_r(e, buff, sizeof(buff))); return NULL; } diff -ru a/main.cpp b/main.cpp --- a/main.cpp 2009-06-26 00:15:13.000000000 +0400 +++ b/main.cpp 2022-09-15 01:56:24.304838795 +0300 @@ -43,6 +43,7 @@ int ProcessFile(char *szFileName,char *szLogFileName); int main(int argc, char *argv[]) { + int errors = 0; int hFind; int i; CROSSAPI_FIND_DATA cfd; @@ -126,7 +127,12 @@ if(!ch) break; if(ch==0x0D||ch==0x0A) { szPipedFileName[i]='\0'; - if(*szPipedFileName) ProcessFile(szPipedFileName,szLogFile?szFullLogFile:NULL); + if(*szPipedFileName) { + int rc = ProcessFile(szPipedFileName,szLogFile?szFullLogFile:NULL); + if(rc != 0) { + ++ errors; + } + } i=0; } else { @@ -148,13 +154,16 @@ hFind=CrossAPI_FindFirstFile(szFile,&cfd); if(hFind==-1) { - cerr<<"Cannot open input file "<