diff --git a/handle.c b/handle.c index 8c0223aa..31b5add5 100644 --- a/handle.c +++ b/handle.c @@ -135,7 +135,7 @@ int handle_create(struct snapraid_handle* handle, struct snapraid_file* file) /* advise sequential access */ ret = posix_fadvise(handle->f, 0, 0, POSIX_FADV_SEQUENTIAL); if (ret != 0) { - fprintf(stderr, "Error advising file '%s'. %s.\n", handle->path, strerror(errno)); + fprintf(stderr, "Error advising file '%s'. %s.\n", handle->path, strerror(ret)); return -1; } #endif @@ -190,7 +190,7 @@ int handle_open(struct snapraid_handle* handle, struct snapraid_file* file) /* advise sequential access */ ret = posix_fadvise(handle->f, 0, 0, POSIX_FADV_SEQUENTIAL); if (ret != 0) { - fprintf(stderr, "Error advising file '%s'. %s.\n", handle->path, strerror(errno)); + fprintf(stderr, "Error advising file '%s'. %s.\n", handle->path, strerror(ret)); return -1; } #endif diff --git a/parity.c b/parity.c index f86bacb4..a629ec4c 100644 --- a/parity.c +++ b/parity.c @@ -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