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:
Jan Polensky
2025-10-07 17:12:14 +02:00
committed by Jan Höppner
parent dd818ccc15
commit 8ad28f7856
7 changed files with 17 additions and 10 deletions
+2 -1
View File
@@ -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;