X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=compat%2Flib%2Fbylabel.c;h=07f0dd92320ccb112b773a9eb54e44b1a826256c;hb=95c74f382492999827000f544fcb6844150cda81;hp=065d52985c5629ec810e53f2ae46953bf045b4c1;hpb=43460f04f3920ae39f345a2fb39d000a890a4283;p=dump.git diff --git a/compat/lib/bylabel.c b/compat/lib/bylabel.c index 065d529..07f0dd9 100644 --- a/compat/lib/bylabel.c +++ b/compat/lib/bylabel.c @@ -12,6 +12,7 @@ */ #include +#include #include #include #include @@ -55,11 +56,11 @@ get_label_uuid(const char *device, char **label, char *uuid) { int fd; struct ext2_super_block e2sb; - fd = open(device, O_RDONLY); + fd = OPEN(device, O_RDONLY); if (fd < 0) return 1; - if (lseek(fd, EXT2_SUPER_OFFSET, SEEK_SET) != EXT2_SUPER_OFFSET || + if (LSEEK(fd, EXT2_SUPER_OFFSET, SEEK_SET) != EXT2_SUPER_OFFSET || read(fd, (char *) &e2sb, EXT2_SUPER_SIZE) != EXT2_SUPER_SIZE || ext2magic(e2sb) != EXT2_SUPER_MAGIC) { close(fd);