mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-29 02:31:05 +00:00
Make grub_util_fd_seek match behaviour of other grub_util_fd_* and
fseeko.
This commit is contained in:
1 parent
dac86b182c
commit
b73249d260
9 files changed
+39
-32
No files matched your search
@@ -139,15 +139,14 @@ grub_util_get_fd_size_file (grub_util_fd_t fd,
|
||||
return ro;
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_util_fd_seek (grub_util_fd_t fd, const char *name, grub_uint64_t off)
|
||||
int
|
||||
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off)
|
||||
{
|
||||
switch (fd->type)
|
||||
{
|
||||
case GRUB_UTIL_FD_FILE:
|
||||
if (lseek (fd->fd, 0, SEEK_SET) == (off_t) -1)
|
||||
return grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"),
|
||||
name, strerror (errno));
|
||||
return -1;
|
||||
fd->off = off;
|
||||
return 0;
|
||||
case GRUB_UTIL_FD_DISK:
|
||||
@@ -155,7 +154,7 @@ grub_util_fd_seek (grub_util_fd_t fd, const char *name, grub_uint64_t off)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
grub_util_fd_t
|
||||
|
||||
Reference in new issue
Block a user