diff --git a/src/oshash.c b/src/oshash.c index 8701830..0d79d65 100644 --- a/src/oshash.c +++ b/src/oshash.c @@ -100,19 +100,24 @@ unsigned long long gen_oshash(char const *filename) { return t1; } -void print_oshash(FILE *output, char const *filename) { +int print_oshash(FILE *output, char const *filename) { char hash[32]; #ifdef WIN32 sprintf(hash, "%016I64x", gen_oshash(filename)); #else sprintf(hash, "%016qx", gen_oshash(filename)); #endif - if (strcmp(hash,"0000000000000000") > 0) + if (strcmp(hash,"0000000000000000") > 0) { fprintf(output, "%s %s\n", hash, filename); + return 0; + } else { + fprintf(output,"%s: No such file or permission denied\n",filename); + return 1; + } } int main(int argc, char **argv) { - int i; + int i,r=0; FILE* output = stdout; if(argc == 1) { @@ -120,6 +125,6 @@ int main(int argc, char **argv) { exit(1); } for(i=1;i0?1:0; }