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

View File

@@ -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;