summaryrefslogtreecommitdiff
blob: 81eb170fcbae588dd55a8f5765949abce3fe4fa2 (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
From 2f51ba47d4e16aaa877956e2876f81ed50af5c5d Mon Sep 17 00:00:00 2001
From: Andi Shyti <andi@etezian.org>
Date: Wed, 24 Jul 2013 12:31:05 +0200
Subject: [PATCH] ioctls: btrfs-control: fix header inclusion order
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch enables newer linux/btrfs.h in Kernel headers 3.11,
where NULL is not recognized as a define. This is done by
including  stdlib.h before linux/btrfs.h. It gets rid of the
following compiling error:

In file included from ioctls/btrfs-control.c:5:0:
/usr/include/linux/btrfs.h: In function ‘btrfs_err_str’:
/usr/include/linux/btrfs.h:486:11: error: ‘NULL’ undeclared (first use in
    return NULL;
           ^

Signed-off-by: Andi Shyti <andi@etezian.org>
---
 ioctls/btrfs-control.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ioctls/btrfs-control.c b/ioctls/btrfs-control.c
index 35e5389..3b0b50a 100644
--- a/ioctls/btrfs-control.c
+++ b/ioctls/btrfs-control.c
@@ -2,6 +2,7 @@
 
 #ifdef USE_BTRFS
 
+#include <stdlib.h>
 #include <linux/btrfs.h>
 
 #include "trinity.h"
-- 
1.8.3.2