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
+2
-1
@@ -12,6 +12,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "lib/util_libc.h"
|
||||
#include "lib/util_path.h"
|
||||
|
||||
#include "attrib.h"
|
||||
@@ -574,7 +575,7 @@ static bool read_full_id(struct ccwgroup_devid *devid_ptr, const char *drv,
|
||||
for (i = 0; i < CCWGROUP_MAX_DEVIDS; i++) {
|
||||
/* Read cdev<n> link target. */
|
||||
link_path = misc_asprintf("%s/cdev%u", path, i);
|
||||
link = misc_readlink(link_path);
|
||||
link = util_readlink(link_path);
|
||||
free(link_path);
|
||||
if (!link) {
|
||||
result = false;
|
||||
|
||||
Reference in New Issue
Block a user