All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
Date: Mon, 9 Jan 2012 12:23:13 -0500	[thread overview]
Message-ID: <201201091223.14655.vapier@gentoo.org> (raw)
In-Reply-To: <CAGH67wSHbU+1ptij7-X9ysU2CZXFOxtD7NYD9Yn0SuRtXThaUg@mail.gmail.com>


[-- Attachment #1.1: Type: Text/Plain, Size: 2786 bytes --]

On Monday 09 January 2012 12:11:50 Garrett Cooper wrote:
> On Mon, Jan 9, 2012 at 2:51 AM, Eryu Guan <eguan@redhat.com> wrote:
> > On Mon, Jan 09, 2012 at 05:44:35PM +0800, Caspar Zhang wrote:
> >> if <attr/xattr.h> doesn't exist, compliation will fail. Fix it in
> >> autotools level.
> > >
> >> --- a/testcases/kernel/syscalls/getxattr/getxattr01.c
> >> +++ b/testcases/kernel/syscalls/getxattr/getxattr01.c
> >> @@ -37,7 +37,6 @@
> >> 
> >>  #include <sys/types.h>
> >>  #include <sys/stat.h>
> >> -#include <attr/xattr.h>
> >>  #include <errno.h>
> >>  #include <fcntl.h>
> >>  #include <unistd.h>
> >> @@ -45,9 +44,16 @@
> >>  #include <stdlib.h>
> >>  #include <string.h>
> >> 
> >> +#include "config.h"
> >>  #include "test.h"
> >>  #include "usctest.h"
> >> 
> >> +char *TCID = "getxattr01";
> >> +
> >> +#ifdef HAVE_ATTR_XATTR_H
> >> +
> >> +#include <attr/xattr.h>
> >> +
> >>  #define XATTR_TEST_KEY "user.testkey"
> >>  #define XATTR_TEST_VALUE "this is a test value"
> >>  #define XATTR_TEST_VALUE_SIZE 20
> >> @@ -56,7 +62,6 @@
> >>  static void setup(void);
> >>  static void cleanup(void);
> >> 
> >> -char *TCID = "getxattr01";
> >>  char filename[BUFSIZ];
> >> 
> >>  struct test_case {
> >> @@ -171,3 +176,9 @@ static void cleanup(void)
> >>       TEST_CLEANUP;
> >>       tst_rmdir();
> >>  }
> >> +#else /* HAVE_ATTR_XATTR_H */
> >> +int main(int argc, char *argv[])
> >> +{
> >> +     tst_brkm(TCONF, NULL, "<attr/xattr.h> does not exist.");
> >> +}
> >> +#endif
> >> diff --git a/testcases/kernel/syscalls/getxattr/getxattr02.c
> >> b/testcases/kernel/syscalls/getxattr/getxattr02.c index
> >> 54d8949..52c5812 100644
> >> --- a/testcases/kernel/syscalls/getxattr/getxattr02.c
> >> +++ b/testcases/kernel/syscalls/getxattr/getxattr02.c
> >> @@ -41,7 +41,6 @@
> >>  #include <sys/types.h>
> >>  #include <sys/stat.h>
> >>  #include <sys/wait.h>
> >> -#include <attr/xattr.h>
> >>  #include <errno.h>
> >>  #include <fcntl.h>
> >>  #include <unistd.h>
> >> @@ -50,9 +49,16 @@
> >>  #include <stdlib.h>
> >>  #include <string.h>
> >> 
> >> +#include "config.h"
> >>  #include "test.h"
> >>  #include "usctest.h"
> >> 
> >> +char *TCID = "getxattr02";
> >> +
> >> +#ifdef HAVE_ATTR_XATTR_H
> >> +
> >> +#include <attr/xattr.h>
> 
> The only thing requested is that:
> 
> #ifdef HAVE_ATTR_XATTR_H
> #include <attr/xattr.h>
> #endif
> 
> (please note the whitespace difference) be moved further up in the
> file to be sorted properly with the rest of the #includes, as noted in
> the style guide.

config.h should come before any include, and then the attr/xattr.h evaluation 
be in the normal location -- after C library includes and before LTP includes 
(like test.h).
-mike

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 430 bytes --]

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2012-01-09 17:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09  9:44 [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist Caspar Zhang
2012-01-09  9:54 ` Markos Chandras
2012-01-09 17:09   ` Garrett Cooper
2012-01-09 17:17   ` Mike Frysinger
2012-01-09 10:51 ` Eryu Guan
2012-01-09 17:11   ` Garrett Cooper
2012-01-09 17:23     ` Mike Frysinger [this message]
2012-01-09 17:32       ` Garrett Cooper
2012-01-10  3:01 ` [LTP] [PATCH v2] " Caspar Zhang
2012-01-10  3:30   ` Eryu Guan
2012-01-11 15:24   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201201091223.14655.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.