[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grub-core/osdep/unix/hostdisk.c: remove support for ancient glibc
From: |
Felix Janda |
Subject: |
Re: grub-core/osdep/unix/hostdisk.c: remove support for ancient glibc |
Date: |
Fri, 5 Dec 2014 18:50:16 +0100 |
User-agent: |
Mutt/1.5.22 (2013-10-16) |
Andrei Borzenkov wrote:
> В Thu, 4 Dec 2014 23:21:09 +0100
> Felix Janda <address@hidden> пишет:
[..]
> > Another solution I would be happy with, is to change the conditions
> >
> > # if !defined(__GLIBC__) || \
> > ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
> >
> > to
> >
> > # ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
> >
>
> This will likely result in build error if __GLIBC__ is undefined.
Right, the condition is wrong if __GLIBC__ is undefined. How about
the below patch?
Felix
--- a/grub-2.02~beta2/grub-core/osdep/unix/hostdisk.c
+++ b/grub-2.02~beta2/grub-core/osdep/unix/hostdisk.c
@@ -48,7 +48,7 @@
#ifdef __linux__
# include <sys/ioctl.h> /* ioctl */
# include <sys/mount.h>
-# if !defined(__GLIBC__) || \
+# if defined(__GLIBC__) && \
((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
/* Maybe libc doesn't have large file support. */
# include <linux/unistd.h> /* _llseek */
@@ -79,8 +79,8 @@
return st.st_size;
}
-#if defined(__linux__) && (!defined(__GLIBC__) || \
- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
+#if defined(__linux__) && defined(__GLIBC__) && \
+ ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
/* Maybe libc doesn't have large file support. */
int
grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off)