With posix_fadivse the error is the return value and not errno.

This commit is contained in:
Andrea Mazzoleni 2012-01-21 20:52:37 +01:00
parent 07da751bb4
commit c4263a4193
2 changed files with 4 additions and 4 deletions

View file

@ -119,7 +119,7 @@ int parity_create(struct snapraid_parity* parity, const char* path, data_off_t s
/* advise sequential access */
ret = posix_fadvise(parity->f, 0, 0, POSIX_FADV_SEQUENTIAL);
if (ret != 0) {
fprintf(stderr, "Error advising parity file '%s'. %s.\n", parity->path, strerror(errno));
fprintf(stderr, "Error advising parity file '%s'. %s.\n", parity->path, strerror(ret));
goto bail;
}
#endif
@ -160,7 +160,7 @@ int parity_open(struct snapraid_parity* parity, const char* path)
/* advise sequential access */
ret = posix_fadvise(parity->f, 0, 0, POSIX_FADV_SEQUENTIAL);
if (ret != 0) {
fprintf(stderr, "Error advising parity file '%s'. %s.\n", parity->path, strerror(errno));
fprintf(stderr, "Error advising parity file '%s'. %s.\n", parity->path, strerror(ret));
goto bail;
}
#endif