mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdev: Use util_readlink() for consistent error handling
Avoid code duplication and inconsistent error handling by replacing readlink() with util_readlink(), which is used project-wide to standardize readlink() usage. Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
dd818ccc15
commit
8ad28f7856
@@ -15,6 +15,7 @@
|
||||
#include <sys/sysmacros.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "lib/util_libc.h"
|
||||
#include "lib/util_path.h"
|
||||
|
||||
#include "devnode.h"
|
||||
@@ -155,7 +156,7 @@ static struct devnode *devnode_from_majmin(devnode_t type, unsigned int major,
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
link = misc_readlink(path);
|
||||
link = util_readlink(path);
|
||||
if (!link)
|
||||
goto out;
|
||||
|
||||
@@ -359,7 +360,7 @@ char *devnode_readlink(struct devnode *devnode)
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
link = misc_readlink(path);
|
||||
link = util_readlink(path);
|
||||
free(path);
|
||||
|
||||
return link;
|
||||
|
||||
Reference in New Issue
Block a user