diff options
author | Peter Jones <pjones@redhat.com> | 2005-11-17 00:16:42 +0000 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2005-11-17 00:16:42 +0000 |
commit | 5ae76884b0ad8d7de624a9b38d56529b89511e28 (patch) | |
tree | 2074672c97a1aa926c42c66400942fbb6a51a15f /isys/devnodes.c | |
parent | 5881e85fc372facd53ae4ea0bf676c547458e1f5 (diff) | |
download | anaconda-5ae76884b0ad8d7de624a9b38d56529b89511e28.tar.gz anaconda-5ae76884b0ad8d7de624a9b38d56529b89511e28.tar.xz anaconda-5ae76884b0ad8d7de624a9b38d56529b89511e28.zip |
- eliminate one useless variable
- check one error case better
Diffstat (limited to 'isys/devnodes.c')
-rw-r--r-- | isys/devnodes.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/isys/devnodes.c b/isys/devnodes.c index 31695b8d4..423e8c431 100644 --- a/isys/devnodes.c +++ b/isys/devnodes.c @@ -97,16 +97,17 @@ int devMakeInode(char * devName, char * path) { if (!strncmp(devName, "mapper/", 7)) { struct dm_task *task; struct dm_info *info = alloca(sizeof *info); - char *realName = devName + 7; - - if (!info || !*realName) + + devName += 7; + if (!info || !*devName) return -3; + memset(info, '\0', sizeof (*info)); task = dm_task_create(DM_DEVICE_INFO); if (!task) return -3; - dm_task_set_name(task, realName); + dm_task_set_name(task, devName); i = dm_task_run(task); if (i < 0) { dm_task_destroy(task); @@ -326,9 +327,8 @@ int devMakeInode(char * devName, char * path) { } unlink(path); - if (mknod(path, type | 0600, makedev(major, minor))) { + if (mknod(path, type | 0600, makedev(major, minor)) < 0) return -2; - } return 0; } |