summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7c5925a)
add_mount() is OK with unknow file type, but we have to initalize
the variable to NULL not to pass garbage on error.
const char *post) {
_cleanup_blkid_free_probe_ blkid_probe b = NULL;
const char *post) {
_cleanup_blkid_free_probe_ blkid_probe b = NULL;
+ const char *fstype = NULL;
r = blkid_do_safeprobe(b);
if (r == -2 || r == 1) /* no result or uncertain */
return 0;
r = blkid_do_safeprobe(b);
if (r == -2 || r == 1) /* no result or uncertain */
return 0;
- else if (r != 0) {
- if (errno == 0)
- errno = EIO;
- log_error_errno(errno, "Failed to probe %s: %m", what);
- return -errno;
- }
+ else if (r != 0)
+ return log_error_errno(errno ?: EIO, "Failed to probe %s: %m", what);
- blkid_probe_lookup_value(b, "TYPE", &fstype, NULL);
+ /* add_mount is OK with fstype being NULL. */
+ (void) blkid_probe_lookup_value(b, "TYPE", &fstype, NULL);