From: hpa Date: Wed, 16 Apr 2003 03:20:25 +0000 (+0000) Subject: Pass O_LARGEFILE to open() in case we want to link on something that X-Git-Tag: syslinux-3.11~571 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8428eba6d5889a4647370a02324e48d6ada05482;p=platform%2Fupstream%2Fsyslinux.git Pass O_LARGEFILE to open() in case we want to link on something that doesn't have _FILE_OFFSET_BITS=64, like klibc. We only touch the first 512 bytes regardless, so it's completely harmless even if we only get 32 bits. --- diff --git a/syslinux-nomtools.c b/syslinux-nomtools.c index 9e83835..f2dba34 100644 --- a/syslinux-nomtools.c +++ b/syslinux-nomtools.c @@ -20,8 +20,9 @@ * mtools, but requires root privilege. */ -#define _XOPEN_SOURCE 500 /* Required on glibc 2.x */ -#define _BSD_SOURCE +#define _XOPEN_SOURCE 500 /* For pread() pwrite() */ +#define _BSD_SOURCE /* For seteuid() */ +#define _LARGEFILE64_SOURCE /* For O_LARGEFILE */ #include #include #include @@ -230,7 +231,7 @@ int main(int argc, char *argv[]) * First make sure we can open the device at all, and that we have * read/write permission. */ - dev_fd = open(device, O_RDWR); + dev_fd = open(device, O_RDWR|O_LARGEFILE); if ( dev_fd < 0 || fstat(dev_fd, &st) < 0 ) { perror(device); exit(1);