correct usage of `unlink()' error return value -1

This commit is contained in:
h_vogt 2012-06-25 15:13:02 +02:00
parent 4a75ce744d
commit 188acd0060
1 changed files with 2 additions and 2 deletions

View File

@ -1188,7 +1188,7 @@ main(int argc, char **argv)
if(!tempfile) {
perror("tmpfile()");
exit(1);
sp_shutdown(EXIT_BAD);
}
if (optind == argc && !istty)
@ -1246,7 +1246,7 @@ main(int argc, char **argv)
}
#if defined(HAS_WINDOWS) || defined(_MSC_VER) || defined(__MINGW32__)
if (tempfile && tpf && unlink(tpf))
if (tpf && (unlink(tpf)==-1))
perror("Could not delete temp file");
#endif