aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/xwrap.c8
-rw-r--r--toys/other/losetup.c3
2 files changed, 2 insertions, 9 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 4516250f..4d8ad711 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -421,14 +421,6 @@ error:
return NULL;
}
-// Resolve all symlinks, returning malloc() memory.
-char *xrealpath(char *path)
-{
- char *new = realpath(path, NULL);
- if (!new) perror_exit("realpath '%s'", path);
- return new;
-}
-
void xchdir(char *path)
{
if (chdir(path)) error_exit("chdir '%s'", path);
diff --git a/toys/other/losetup.c b/toys/other/losetup.c
index aad722e4..e96a125d 100644
--- a/toys/other/losetup.c
+++ b/toys/other/losetup.c
@@ -106,8 +106,9 @@ static void loopback_setup(char *device, char *file)
}
// Associate file with this device?
} else if (file) {
- char *s = xrealpath(file);
+ char *s = xabspath(file, 1);
+ if (!s) perror_exit("file"); // already opened, but if deleted since...
if (ioctl(lfd, LOOP_SET_FD, ffd)) perror_exit("%s=%s", device, file);
loop->lo_offset = TT.offset;
loop->lo_sizelimit = TT.size;