mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-01 12:26:38 -05:00
Fixes some error conditions reported by clang.
This commit is contained in:
parent
fceaa8a4cf
commit
0cffb46050
2 changed files with 3 additions and 3 deletions
4
handle.c
4
handle.c
|
|
@ -200,12 +200,12 @@ int handle_close(struct snapraid_handle* handle)
|
||||||
if (handle->f != -1) {
|
if (handle->f != -1) {
|
||||||
ret = close(handle->f);
|
ret = close(handle->f);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
fprintf(stderr, "Error closing file '%s'. %s.\n", handle->file->sub, strerror(errno));
|
||||||
|
|
||||||
/* invalidate for error */
|
/* invalidate for error */
|
||||||
handle->file = 0;
|
handle->file = 0;
|
||||||
handle->f = -1;
|
handle->f = -1;
|
||||||
handle->valid_size = 0;
|
handle->valid_size = 0;
|
||||||
|
|
||||||
fprintf(stderr, "Error closing file '%s'. %s.\n", handle->file->sub, strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
parity.c
2
parity.c
|
|
@ -149,11 +149,11 @@ int parity_chsize(struct snapraid_parity* parity, data_off_t size, data_off_t* o
|
||||||
const char* call;
|
const char* call;
|
||||||
|
|
||||||
#if HAVE_FALLOCATE
|
#if HAVE_FALLOCATE
|
||||||
|
call = "fallocate";
|
||||||
if (!skip_fallocate) {
|
if (!skip_fallocate) {
|
||||||
/* allocate real space using the specific Linux fallocate() operation. */
|
/* allocate real space using the specific Linux fallocate() operation. */
|
||||||
/* If the underline filesystem doesn't support it, this operation fails, */
|
/* If the underline filesystem doesn't support it, this operation fails, */
|
||||||
/* instead posix_fallocate() fallbacks to write the whole file. */
|
/* instead posix_fallocate() fallbacks to write the whole file. */
|
||||||
call = "fallocate";
|
|
||||||
ret = fallocate(parity->f, 0, 0, size);
|
ret = fallocate(parity->f, 0, 0, size);
|
||||||
|
|
||||||
/* fallocate() returns the error number as positive integer, */
|
/* fallocate() returns the error number as positive integer, */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue