On Mon, Jan 9, 2012 at 2:51 AM, Eryu Guan <[email protected]> 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.
>
> Tested on system without xattr.h and everything worked fine.
>
> Thanks for fixing this!
>
> Eryu Guan
>>
>> Signed-off-by: Caspar Zhang <[email protected]>
>> ---
>>  configure.ac                                    |    1 +
>>  testcases/kernel/syscalls/getxattr/getxattr01.c |   15 +++++++++++++--
>>  testcases/kernel/syscalls/getxattr/getxattr02.c |   16 +++++++++++++---
>>  testcases/kernel/syscalls/setxattr/setxattr01.c |   15 +++++++++++++--
>>  testcases/kernel/syscalls/setxattr/setxattr02.c |   16 +++++++++++++---
>>  5 files changed, 53 insertions(+), 10 deletions(-)
>>
>
>> diff --git a/configure.ac b/configure.ac
>> index 00d3720..6b3870a 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -36,6 +36,7 @@ AC_CHECK_HEADERS([ \
>>      libaio.h \
>>      mm.h \
>>      pthread.h \
>> +    attr/xattr.h \
>>      linux/genetlink.h \
>>      linux/mempolicy.h \
>>      linux/module.h \
>> diff --git a/testcases/kernel/syscalls/getxattr/getxattr01.c 
>> b/testcases/kernel/syscalls/getxattr/getxattr01.c
>> index 8db6743..c74ffc9 100644
>> --- 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.
Thanks,
-Garrett

------------------------------------------------------------------------------
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
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to