summaryrefslogtreecommitdiff
path: root/dev-db/mydumper/files/mydumper-0.15-fix-call-to-open.patch
blob: 46c7f6aea8c5f1cd8764be2af4a7fa26d4000c65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From https://github.com/mydumper/mydumper/pull/1557
From: Brahmajit Das <brahmajit.xyz@gmail.com>
Date: Sun, 7 Jul 2024 20:40:30 +0000
Subject: [PATCH] Fix building on musl libc

On musl libc we are getting buid errors:
mydumper/src/mydumper_stream.c:100:9: error: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-
function-declaration]
  100 |       f=open(sf->filename,O_RDONLY);
      |         ^~~~
      |         popen
mydumper/src/mydumper_stream.c:100:27: error: 'O_RDONLY' undeclared (first use in this function)
  100 |       f=open(sf->filename,O_RDONLY);
      |                           ^~~~~~~~
This probably due to musl being more strict. Fix was to include the
fcntl.h header file as the Linux Manual Page suggests open should come
from fcntl.h

First reported on Gentoo Linux with musl profile

Bug: https://bugs.gentoo.org/935389
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
--- a/src/mydumper_common.c
+++ b/src/mydumper_common.c
@@ -20,6 +20,7 @@
 */
 #include "string.h"
 #include <stdlib.h>
+#include <fcntl.h>
 #include <mysql.h>
 #include <glib.h>
 #include <glib/gstdio.h>
--- a/src/mydumper_stream.c
+++ b/src/mydumper_stream.c
@@ -26,6 +26,7 @@
 #include "mydumper_stream.h"
 #include <sys/file.h>
 #include <errno.h>
+#include <fcntl.h>
 
 extern GAsyncQueue *stream_queue;