diff mbox

[1/1] btrfs-progs: compilation errors when using musl libc

Message ID 1438195057-9400-1-git-send-email-brendanheading@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Brendan Heading July 29, 2015, 6:37 p.m. UTC
- limits.h must be included to pick up PATH_MAX.
- remove double declaration of BTRFS_DISABLE_BACKTRACE

kerncompat.h assumed that if __GLIBC__ was not defined,
it could safely define BTRFS_DISABLE_BACKTRACE, however this can be
defined by the configure script. Added a check to ensure it is not
defined first.

Signed-off-by: Brendan Heading <brendanheading@gmail.com>
---
 cmds-inspect.c | 1 +
 cmds-receive.c | 1 +
 cmds-scrub.c   | 1 +
 cmds-send.c    | 1 +
 kerncompat.h   | 2 ++
 5 files changed, 6 insertions(+)

Comments

David Sterba July 30, 2015, 9:22 a.m. UTC | #1
On Wed, Jul 29, 2015 at 07:37:37PM +0100, Brendan Heading wrote:
> - limits.h must be included to pick up PATH_MAX.
> - remove double declaration of BTRFS_DISABLE_BACKTRACE
> 
> kerncompat.h assumed that if __GLIBC__ was not defined,
> it could safely define BTRFS_DISABLE_BACKTRACE, however this can be
> defined by the configure script. Added a check to ensure it is not
> defined first.
> 
> Signed-off-by: Brendan Heading <brendanheading@gmail.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-inspect.c b/cmds-inspect.c
index 71451fe..9712581 100644
--- a/cmds-inspect.c
+++ b/cmds-inspect.c
@@ -20,6 +20,7 @@ 
 #include <stdint.h>
 #include <sys/ioctl.h>
 #include <errno.h>
+#include <limits.h>
 
 #include "kerncompat.h"
 #include "ioctl.h"
diff --git a/cmds-receive.c b/cmds-receive.c
index 071bea9..d4b3103 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -28,6 +28,7 @@ 
 #include <wait.h>
 #include <assert.h>
 #include <getopt.h>
+#include <limits.h>
 
 #include <sys/stat.h>
 #include <sys/types.h>
diff --git a/cmds-scrub.c b/cmds-scrub.c
index b7aa809..5a85dc4 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -34,6 +34,7 @@ 
 #include <ctype.h>
 #include <signal.h>
 #include <stdarg.h>
+#include <limits.h>
 
 #include "ctree.h"
 #include "ioctl.h"
diff --git a/cmds-send.c b/cmds-send.c
index 20bba18..a0b7f95 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -33,6 +33,7 @@ 
 #include <assert.h>
 #include <getopt.h>
 #include <uuid/uuid.h>
+#include <limits.h>
 
 #include "ctree.h"
 #include "ioctl.h"
diff --git a/kerncompat.h b/kerncompat.h
index 5d92856..7c627ba 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -33,7 +33,9 @@ 
 #include <features.h>
 
 #ifndef __GLIBC__
+#ifndef BTRFS_DISABLE_BACKTRACE
 #define BTRFS_DISABLE_BACKTRACE
+#endif
 #define __always_inline __inline __attribute__ ((__always_inline__))
 #endif