aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2003-04-16 03:20:25 +0000
committerhpa <hpa>2003-04-16 03:20:25 +0000
commit8428eba6d5889a4647370a02324e48d6ada05482 (patch)
treed77a049caeb344af1a1c3b2f9e551fdf88e7b5f1
parent5bc83a208a25f61313597d734d8a6f561fba6417 (diff)
downloadsyslinux-elf-8428eba6d5889a4647370a02324e48d6ada05482.tar.gz
syslinux-elf-8428eba6d5889a4647370a02324e48d6ada05482.tar.xz
syslinux-elf-8428eba6d5889a4647370a02324e48d6ada05482.zip
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.
-rw-r--r--syslinux-nomtools.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/syslinux-nomtools.c b/syslinux-nomtools.c
index 9e838358..f2dba342 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 <alloca.h>
#include <errno.h>
#include <fcntl.h>
@@ -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);