summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2016-09-22 14:47:57 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2016-09-22 14:47:57 +0100
commitc92ba05933a640c0084321bc6eeaa091c283b8bb (patch)
tree72cdcdec5d50586a244ba8743356d3fd2ecb1b4c /mkfs.c
parent249a3592d5dfdec0e52b5e9e712339364ea758ed (diff)
New upstream release.
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mkfs.c b/mkfs.c
index b33e3688..4b88987c 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1193,13 +1193,13 @@ static int is_ssd(const char *file)
return 0;
}
- if (read(fd, &rotational, sizeof(char)) < sizeof(char)) {
+ if (read(fd, &rotational, 1) < 1) {
close(fd);
return 0;
}
close(fd);
- return !atoi((const char *)&rotational);
+ return rotational == '0';
}
static int _cmp_device_by_id(void *priv, struct list_head *a,
@@ -1735,7 +1735,7 @@ int main(int argc, char **argv)
}
mkfs_cfg.label = label;
- mkfs_cfg.fs_uuid = fs_uuid;
+ memcpy(mkfs_cfg.fs_uuid, fs_uuid, sizeof(mkfs_cfg.fs_uuid));
memcpy(mkfs_cfg.blocks, blocks, sizeof(blocks));
mkfs_cfg.num_bytes = dev_block_count;
mkfs_cfg.nodesize = nodesize;