if (max_use < DEFAULT_MAX_USE_LOWER)
max_use = DEFAULT_MAX_USE_LOWER;
}
-
- max_use = DEFAULT_MAX_USE_LOWER;
+ else
+ max_use = DEFAULT_MAX_USE_LOWER;
} else
max_use = PAGE_ALIGN(max_use);
return 0;
if (exclude_fd >= 0) {
- if (fstat(exclude_fd, &exclude_st) < 0) {
- log_error("Failed to fstat(): %m");
- return -errno;
- }
+ if (fstat(exclude_fd, &exclude_st) < 0)
+ return log_error_errno(errno, "Failed to fstat(): %m");
}
/* This algorithm will keep deleting the oldest file of the
if (errno == ENOENT)
return 0;
- log_error("Can't open coredump directory: %m");
+ log_error_errno(errno, "Can't open coredump directory: %m");
return -errno;
}
exclude_st.st_ino == st.st_ino)
continue;
- r = hashmap_ensure_allocated(&h, NULL, NULL);
+ r = hashmap_ensure_allocated(&h, NULL);
if (r < 0)
return log_oom();
if (errno == ENOENT)
continue;
- log_error("Failed to remove file %s: %m", worst->oldest_file);
+ log_error_errno(errno, "Failed to remove file %s: %m", worst->oldest_file);
return -errno;
} else
log_info("Removed old coredump %s.", worst->oldest_file);
return 0;
fail:
- log_error("Failed to read directory: %m");
+ log_error_errno(errno, "Failed to read directory: %m");
return -errno;
}