From d63149a652d3bc2f83388927346c20bb604537e2 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Mon, 20 Dec 2021 06:38:51 +0100 Subject: [PATCH] limine-install: Add O_BINARY flag to open() on win32 --- limine-install/limine-install.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/limine-install/limine-install.c b/limine-install/limine-install.c index 6038945c..b4775493 100644 --- a/limine-install/limine-install.c +++ b/limine-install/limine-install.c @@ -10,6 +10,10 @@ #include #include +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #define DIV_ROUNDUP(a, b) (((a) + ((b) - 1)) / (b)) struct gpt_table_header { @@ -287,7 +291,7 @@ int main(int argc, char *argv[]) { } } - device = open(argv[1], O_RDWR); + device = open(argv[1], O_RDWR | O_BINARY); if (device == -1) { perror("ERROR"); goto cleanup;