public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ioctls: btrfs-control: fix header inclusion order
@ 2013-07-23 19:35 Andi Shyti
  2013-07-23 23:30 ` Andi Shyti
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Shyti @ 2013-07-23 19:35 UTC (permalink / raw)
  To: tt.rantala; +Cc: trinity, mikko.rapeli, andi

This patch enables older linux/btrfs.h where NULL is not
recognized as a define. 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 this function)
    return NULL;
           ^

This is done by postponing the inclusion of btrf.h

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

diff --git a/ioctls/btrfs-control.c b/ioctls/btrfs-control.c
index 35e5389..8d1e2d9 100644
--- a/ioctls/btrfs-control.c
+++ b/ioctls/btrfs-control.c
@@ -2,11 +2,11 @@
 
 #ifdef USE_BTRFS
 
-#include <linux/btrfs.h>
-
 #include "trinity.h"
 #include "ioctls.h"
 
+#include <linux/btrfs.h>
+
 static const struct ioctl btrfs_control_ioctls[] = {
 	IOCTL(BTRFS_IOC_SCAN_DEV),
 	IOCTL(BTRFS_IOC_DEVICES_READY),
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ioctls: btrfs-control: fix header inclusion order
  2013-07-23 19:35 [PATCH] ioctls: btrfs-control: fix header inclusion order Andi Shyti
@ 2013-07-23 23:30 ` Andi Shyti
  2013-07-23 23:39   ` [PATCH v2] " Andi Shyti
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Shyti @ 2013-07-23 23:30 UTC (permalink / raw)
  To: tt.rantala; +Cc: trinity, mikko.rapeli

> This patch enables older linux/btrfs.h where NULL is not
                      ^^^

This was supposed to be newer, I'll come with patch v2

Andi

> recognized as a define. 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 this function)
>     return NULL;
>            ^
> 
> This is done by postponing the inclusion of btrf.h
> 
> Signed-off-by: Andi Shyti <andi@etezian.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] ioctls: btrfs-control: fix header inclusion order
  2013-07-23 23:30 ` Andi Shyti
@ 2013-07-23 23:39   ` Andi Shyti
  2013-07-24  6:56     ` Tommi Rantala
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Shyti @ 2013-07-23 23:39 UTC (permalink / raw)
  To: tt.rantala; +Cc: trinity, andi, mikko.rapeli

This patch enables newer linux/btrfs.h in Kernel headers 3.11,
where NULL is not recognized as a define. 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 this function)
    return NULL;
           ^

This is done by postponing the inclusion of btrf.h

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

diff --git a/ioctls/btrfs-control.c b/ioctls/btrfs-control.c
index 35e5389..8d1e2d9 100644
--- a/ioctls/btrfs-control.c
+++ b/ioctls/btrfs-control.c
@@ -2,11 +2,11 @@
 
 #ifdef USE_BTRFS
 
-#include <linux/btrfs.h>
-
 #include "trinity.h"
 #include "ioctls.h"
 
+#include <linux/btrfs.h>
+
 static const struct ioctl btrfs_control_ioctls[] = {
 	IOCTL(BTRFS_IOC_SCAN_DEV),
 	IOCTL(BTRFS_IOC_DEVICES_READY),
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] ioctls: btrfs-control: fix header inclusion order
  2013-07-23 23:39   ` [PATCH v2] " Andi Shyti
@ 2013-07-24  6:56     ` Tommi Rantala
  2013-07-24 10:31       ` [PATCH v3] " Andi Shyti
  0 siblings, 1 reply; 5+ messages in thread
From: Tommi Rantala @ 2013-07-24  6:56 UTC (permalink / raw)
  To: Andi Shyti; +Cc: trinity, mikko.rapeli

2013/7/24 Andi Shyti <andi@etezian.org>:
> This patch enables newer linux/btrfs.h in Kernel headers 3.11,
> where NULL is not recognized as a define. 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 this function)
>     return NULL;
>            ^
>
> This is done by postponing the inclusion of btrf.h
>
> Signed-off-by: Andi Shyti <andi@etezian.org>
> ---
>  ioctls/btrfs-control.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ioctls/btrfs-control.c b/ioctls/btrfs-control.c
> index 35e5389..8d1e2d9 100644
> --- a/ioctls/btrfs-control.c
> +++ b/ioctls/btrfs-control.c
> @@ -2,11 +2,11 @@
>
>  #ifdef USE_BTRFS
>
> -#include <linux/btrfs.h>
> -
>  #include "trinity.h"
>  #include "ioctls.h"
>
> +#include <linux/btrfs.h>
> +

Thanks for the patch!

I have one comment: if you look at other files in ioctl/, we're
including the system headers before the trinity headers, so how about
including something like <stdlib.h> before btrfs.h? That should also
fix this, right?

>  static const struct ioctl btrfs_control_ioctls[] = {
>         IOCTL(BTRFS_IOC_SCAN_DEV),
>         IOCTL(BTRFS_IOC_DEVICES_READY),
> --
> 1.8.3.2
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3] ioctls: btrfs-control: fix header inclusion order
  2013-07-24  6:56     ` Tommi Rantala
@ 2013-07-24 10:31       ` Andi Shyti
  0 siblings, 0 replies; 5+ messages in thread
From: Andi Shyti @ 2013-07-24 10:31 UTC (permalink / raw)
  To: tt.rantala; +Cc: trinity, andi, mikko.rapeli

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-24 10:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-23 19:35 [PATCH] ioctls: btrfs-control: fix header inclusion order Andi Shyti
2013-07-23 23:30 ` Andi Shyti
2013-07-23 23:39   ` [PATCH v2] " Andi Shyti
2013-07-24  6:56     ` Tommi Rantala
2013-07-24 10:31       ` [PATCH v3] " Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox