* [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
@ 2012-01-09 9:44 Caspar Zhang
2012-01-09 9:54 ` Markos Chandras
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Caspar Zhang @ 2012-01-09 9:44 UTC (permalink / raw)
To: LTP List
[-- Attachment #1: Type: text/plain, Size: 543 bytes --]
if <attr/xattr.h> doesn't exist, compliation will fail. Fix it in
autotools level.
Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
---
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(-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-syscalls-xattr-fix-compile-when-xattr.h-not-exist.patch --]
[-- Type: text/x-patch; name="0001-syscalls-xattr-fix-compile-when-xattr.h-not-exist.patch", Size: 4790 bytes --]
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>
+
#define XATTR_TEST_KEY "user.testkey"
#define FIFO "getxattr02fifo"
@@ -63,8 +69,6 @@
static void setup(void);
static void cleanup(void);
-char *TCID = "getxattr02";
-
static char *tc[] = {
FIFO, /* case 00, get attr from fifo */
CHR, /* case 01, get attr from char special */
@@ -150,3 +154,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/setxattr/setxattr01.c b/testcases/kernel/syscalls/setxattr/setxattr01.c
index fedb777..581e008 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr01.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr01.c
@@ -46,7 +46,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>
@@ -55,9 +54,16 @@
#include <stdlib.h>
#include <string.h>
+#include "config.h"
#include "test.h"
#include "usctest.h"
+char *TCID = "setxattr01";
+
+#ifdef HAVE_ATTR_XATTR_H
+
+#include <attr/xattr.h>
+
#define XATTR_NAME_MAX 255
#define XATTR_NAME_LEN (XATTR_NAME_MAX + 2)
#define XATTR_SIZE_MAX 65536
@@ -68,7 +74,6 @@
static void setup(void);
static void cleanup(void);
-char *TCID = "setxattr01";
char filename[BUFSIZ];
char long_key[XATTR_NAME_LEN];
char *long_value;
@@ -221,3 +226,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/setxattr/setxattr02.c b/testcases/kernel/syscalls/setxattr/setxattr02.c
index f4ba566..6d36a0e 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr02.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr02.c
@@ -45,7 +45,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>
@@ -54,9 +53,16 @@
#include <stdlib.h>
#include <string.h>
+#include "config.h"
#include "test.h"
#include "usctest.h"
+char *TCID = "setxattr02";
+
+#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
@@ -72,8 +78,6 @@
static void setup(void);
static void cleanup(void);
-char *TCID = "setxattr02";
-
struct test_case {
char *fname;
char *key;
@@ -233,3 +237,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
[-- Attachment #3: 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 #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
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-10 3:01 ` [LTP] [PATCH v2] " Caspar Zhang
2 siblings, 2 replies; 11+ messages in thread
From: Markos Chandras @ 2012-01-09 9:54 UTC (permalink / raw)
To: ltp-list
On 01/09/2012 09:44 AM, Caspar Zhang wrote:
>
> if<attr/xattr.h> doesn't exist, compliation will fail. Fix it in
> autotools level.
>
> Signed-off-by: Caspar Zhang<caspar@casparzhang.com>
> ---
> 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(-)
>
>
>
>
The patch looks good to me. Another approach would be to disable these
two tests for all UCLINUX targets (uClibc does not have attr/xattr.h>)
from testcases/kernel/syscalls Makefile.
--
markos
------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
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 10:51 ` Eryu Guan
2012-01-09 17:11 ` Garrett Cooper
2012-01-10 3:01 ` [LTP] [PATCH v2] " Caspar Zhang
2 siblings, 1 reply; 11+ messages in thread
From: Eryu Guan @ 2012-01-09 10:51 UTC (permalink / raw)
To: Caspar Zhang; +Cc: LTP List
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 <caspar@casparzhang.com>
> ---
> 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>
> +
> #define XATTR_TEST_KEY "user.testkey"
>
> #define FIFO "getxattr02fifo"
> @@ -63,8 +69,6 @@
> static void setup(void);
> static void cleanup(void);
>
> -char *TCID = "getxattr02";
> -
> static char *tc[] = {
> FIFO, /* case 00, get attr from fifo */
> CHR, /* case 01, get attr from char special */
> @@ -150,3 +154,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/setxattr/setxattr01.c b/testcases/kernel/syscalls/setxattr/setxattr01.c
> index fedb777..581e008 100644
> --- a/testcases/kernel/syscalls/setxattr/setxattr01.c
> +++ b/testcases/kernel/syscalls/setxattr/setxattr01.c
> @@ -46,7 +46,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>
> @@ -55,9 +54,16 @@
> #include <stdlib.h>
> #include <string.h>
>
> +#include "config.h"
> #include "test.h"
> #include "usctest.h"
>
> +char *TCID = "setxattr01";
> +
> +#ifdef HAVE_ATTR_XATTR_H
> +
> +#include <attr/xattr.h>
> +
> #define XATTR_NAME_MAX 255
> #define XATTR_NAME_LEN (XATTR_NAME_MAX + 2)
> #define XATTR_SIZE_MAX 65536
> @@ -68,7 +74,6 @@
> static void setup(void);
> static void cleanup(void);
>
> -char *TCID = "setxattr01";
> char filename[BUFSIZ];
> char long_key[XATTR_NAME_LEN];
> char *long_value;
> @@ -221,3 +226,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/setxattr/setxattr02.c b/testcases/kernel/syscalls/setxattr/setxattr02.c
> index f4ba566..6d36a0e 100644
> --- a/testcases/kernel/syscalls/setxattr/setxattr02.c
> +++ b/testcases/kernel/syscalls/setxattr/setxattr02.c
> @@ -45,7 +45,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>
> @@ -54,9 +53,16 @@
> #include <stdlib.h>
> #include <string.h>
>
> +#include "config.h"
> #include "test.h"
> #include "usctest.h"
>
> +char *TCID = "setxattr02";
> +
> +#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
> @@ -72,8 +78,6 @@
> static void setup(void);
> static void cleanup(void);
>
> -char *TCID = "setxattr02";
> -
> struct test_case {
> char *fname;
> char *key;
> @@ -233,3 +237,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
------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
2012-01-09 9:54 ` Markos Chandras
@ 2012-01-09 17:09 ` Garrett Cooper
2012-01-09 17:17 ` Mike Frysinger
1 sibling, 0 replies; 11+ messages in thread
From: Garrett Cooper @ 2012-01-09 17:09 UTC (permalink / raw)
To: Markos Chandras; +Cc: ltp-list
On Mon, Jan 9, 2012 at 1:54 AM, Markos Chandras
<Markos.Chandras@imgtec.com> wrote:
> On 01/09/2012 09:44 AM, Caspar Zhang wrote:
>>
>> if<attr/xattr.h> doesn't exist, compliation will fail. Fix it in
>> autotools level.
>>
>> Signed-off-by: Caspar Zhang<caspar@casparzhang.com>
>> ---
>> 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(-)
>>
>>
>>
>>
> The patch looks good to me. Another approach would be to disable these
> two tests for all UCLINUX targets (uClibc does not have attr/xattr.h>)
> from testcases/kernel/syscalls Makefile.
The proposed method is best because it produces something sane if
someone tries to run the testcase from the directory and the headers
were missing.
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
2012-01-09 10:51 ` Eryu Guan
@ 2012-01-09 17:11 ` Garrett Cooper
2012-01-09 17:23 ` Mike Frysinger
0 siblings, 1 reply; 11+ messages in thread
From: Garrett Cooper @ 2012-01-09 17:11 UTC (permalink / raw)
To: Eryu Guan; +Cc: LTP List
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.
>
> Tested on system without xattr.h and everything worked fine.
>
> Thanks for fixing this!
>
> Eryu Guan
>>
>> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
>> ---
>> 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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
2012-01-09 9:54 ` Markos Chandras
2012-01-09 17:09 ` Garrett Cooper
@ 2012-01-09 17:17 ` Mike Frysinger
1 sibling, 0 replies; 11+ messages in thread
From: Mike Frysinger @ 2012-01-09 17:17 UTC (permalink / raw)
To: ltp-list; +Cc: Markos Chandras
[-- Attachment #1.1: Type: Text/Plain, Size: 1028 bytes --]
On Monday 09 January 2012 04:54:00 Markos Chandras wrote:
> On 01/09/2012 09:44 AM, Caspar Zhang wrote:
> > if<attr/xattr.h> doesn't exist, compliation will fail. Fix it in
> > autotools level.
> >
> > Signed-off-by: Caspar Zhang<caspar@casparzhang.com>
> > ---
> >
> > 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(-)
>
> The patch looks good to me. Another approach would be to disable these
> two tests for all UCLINUX targets (uClibc does not have attr/xattr.h>)
> from testcases/kernel/syscalls Makefile.
no -- it has nothing to do with the C library. attr/xattr.h is provided by
the 3rd party "attr" library.
-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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
2012-01-09 17:11 ` Garrett Cooper
@ 2012-01-09 17:23 ` Mike Frysinger
2012-01-09 17:32 ` Garrett Cooper
0 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2012-01-09 17:23 UTC (permalink / raw)
To: ltp-list
[-- 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH] syscalls/xattr: fix compile when xattr.h not exist
2012-01-09 17:23 ` Mike Frysinger
@ 2012-01-09 17:32 ` Garrett Cooper
0 siblings, 0 replies; 11+ messages in thread
From: Garrett Cooper @ 2012-01-09 17:32 UTC (permalink / raw)
To: Mike Frysinger; +Cc: ltp-list
On Mon, Jan 9, 2012 at 9:23 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> 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).
+1
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 11+ messages in thread
* [LTP] [PATCH v2] syscalls/xattr: fix compile when xattr.h not exist
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 10:51 ` Eryu Guan
@ 2012-01-10 3:01 ` Caspar Zhang
2012-01-10 3:30 ` Eryu Guan
2012-01-11 15:24 ` Cyril Hrubis
2 siblings, 2 replies; 11+ messages in thread
From: Caspar Zhang @ 2012-01-10 3:01 UTC (permalink / raw)
To: LTP List
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
if <attr/xattr.h> doesn't exist, compliation will fail. Fix it in
autotools level.
Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
---
configure.ac | 1 +
testcases/kernel/syscalls/getxattr/getxattr01.c | 16 +++++++++++++---
testcases/kernel/syscalls/getxattr/getxattr02.c | 17 +++++++++++++----
testcases/kernel/syscalls/setxattr/setxattr01.c | 16 +++++++++++++---
testcases/kernel/syscalls/setxattr/setxattr02.c | 17 +++++++++++++----
5 files changed, 53 insertions(+), 14 deletions(-)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-syscalls-xattr-fix-compile-when-xattr.h-not-exist.patch --]
[-- Type: text/x-patch; name="0001-syscalls-xattr-fix-compile-when-xattr.h-not-exist.patch", Size: 5199 bytes --]
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..de4824c 100644
--- a/testcases/kernel/syscalls/getxattr/getxattr01.c
+++ b/testcases/kernel/syscalls/getxattr/getxattr01.c
@@ -35,19 +35,24 @@
* 4. Verify the attribute got by getxattr(2) is same as the value we set
*/
+#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
-#include <attr/xattr.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
+#ifdef HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#endif
#include "test.h"
#include "usctest.h"
+char *TCID = "getxattr01";
+
+#ifdef HAVE_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 +61,6 @@
static void setup(void);
static void cleanup(void);
-char *TCID = "getxattr01";
char filename[BUFSIZ];
struct test_case {
@@ -171,3 +175,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..503fcd0 100644
--- a/testcases/kernel/syscalls/getxattr/getxattr02.c
+++ b/testcases/kernel/syscalls/getxattr/getxattr02.c
@@ -38,10 +38,10 @@
* return -1 and set errno to ENODATA
*/
+#include "config.h"
#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>
@@ -49,10 +49,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
+#ifdef HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#endif
#include "test.h"
#include "usctest.h"
+char *TCID = "getxattr02";
+
+#ifdef HAVE_ATTR_XATTR_H
#define XATTR_TEST_KEY "user.testkey"
#define FIFO "getxattr02fifo"
@@ -63,8 +68,6 @@
static void setup(void);
static void cleanup(void);
-char *TCID = "getxattr02";
-
static char *tc[] = {
FIFO, /* case 00, get attr from fifo */
CHR, /* case 01, get attr from char special */
@@ -150,3 +153,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/setxattr/setxattr01.c b/testcases/kernel/syscalls/setxattr/setxattr01.c
index fedb777..425fcf3 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr01.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr01.c
@@ -43,10 +43,10 @@
* setxattr(2) should succeed
*/
+#include "config.h"
#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>
@@ -54,10 +54,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
+#ifdef HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#endif
#include "test.h"
#include "usctest.h"
+char *TCID = "setxattr01";
+
+#ifdef HAVE_ATTR_XATTR_H
#define XATTR_NAME_MAX 255
#define XATTR_NAME_LEN (XATTR_NAME_MAX + 2)
#define XATTR_SIZE_MAX 65536
@@ -68,7 +73,6 @@
static void setup(void);
static void cleanup(void);
-char *TCID = "setxattr01";
char filename[BUFSIZ];
char long_key[XATTR_NAME_LEN];
char *long_value;
@@ -221,3 +225,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/setxattr/setxattr02.c b/testcases/kernel/syscalls/setxattr/setxattr02.c
index f4ba566..465796c 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr02.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr02.c
@@ -42,10 +42,10 @@
* return -1 and set errno to EPERM
*/
+#include "config.h"
#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>
@@ -53,10 +53,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
+#ifdef HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#endif
#include "test.h"
#include "usctest.h"
+char *TCID = "setxattr02";
+
+#ifdef HAVE_ATTR_XATTR_H
#define XATTR_TEST_KEY "user.testkey"
#define XATTR_TEST_VALUE "this is a test value"
#define XATTR_TEST_VALUE_SIZE 20
@@ -72,8 +77,6 @@
static void setup(void);
static void cleanup(void);
-char *TCID = "setxattr02";
-
struct test_case {
char *fname;
char *key;
@@ -233,3 +236,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
[-- Attachment #3: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH v2] syscalls/xattr: fix compile when xattr.h not exist
2012-01-10 3:01 ` [LTP] [PATCH v2] " Caspar Zhang
@ 2012-01-10 3:30 ` Eryu Guan
2012-01-11 15:24 ` Cyril Hrubis
1 sibling, 0 replies; 11+ messages in thread
From: Eryu Guan @ 2012-01-10 3:30 UTC (permalink / raw)
To: Caspar Zhang; +Cc: LTP List
On Tue, Jan 10, 2012 at 11:01:10AM +0800, Caspar Zhang wrote:
>
> if <attr/xattr.h> doesn't exist, compliation will fail. Fix it in
> autotools level.
>
> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Thanks.
> ---
> configure.ac | 1 +
> testcases/kernel/syscalls/getxattr/getxattr01.c | 16 +++++++++++++---
> testcases/kernel/syscalls/getxattr/getxattr02.c | 17 +++++++++++++----
> testcases/kernel/syscalls/setxattr/setxattr01.c | 16 +++++++++++++---
> testcases/kernel/syscalls/setxattr/setxattr02.c | 17 +++++++++++++----
> 5 files changed, 53 insertions(+), 14 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..de4824c 100644
> --- a/testcases/kernel/syscalls/getxattr/getxattr01.c
> +++ b/testcases/kernel/syscalls/getxattr/getxattr01.c
> @@ -35,19 +35,24 @@
> * 4. Verify the attribute got by getxattr(2) is same as the value we set
> */
>
> +#include "config.h"
> #include <sys/types.h>
> #include <sys/stat.h>
> -#include <attr/xattr.h>
> #include <errno.h>
> #include <fcntl.h>
> #include <unistd.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> -
> +#ifdef HAVE_ATTR_XATTR_H
> +#include <attr/xattr.h>
> +#endif
> #include "test.h"
> #include "usctest.h"
>
> +char *TCID = "getxattr01";
> +
> +#ifdef HAVE_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 +61,6 @@
> static void setup(void);
> static void cleanup(void);
>
> -char *TCID = "getxattr01";
> char filename[BUFSIZ];
>
> struct test_case {
> @@ -171,3 +175,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..503fcd0 100644
> --- a/testcases/kernel/syscalls/getxattr/getxattr02.c
> +++ b/testcases/kernel/syscalls/getxattr/getxattr02.c
> @@ -38,10 +38,10 @@
> * return -1 and set errno to ENODATA
> */
>
> +#include "config.h"
> #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>
> @@ -49,10 +49,15 @@
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> -
> +#ifdef HAVE_ATTR_XATTR_H
> +#include <attr/xattr.h>
> +#endif
> #include "test.h"
> #include "usctest.h"
>
> +char *TCID = "getxattr02";
> +
> +#ifdef HAVE_ATTR_XATTR_H
> #define XATTR_TEST_KEY "user.testkey"
>
> #define FIFO "getxattr02fifo"
> @@ -63,8 +68,6 @@
> static void setup(void);
> static void cleanup(void);
>
> -char *TCID = "getxattr02";
> -
> static char *tc[] = {
> FIFO, /* case 00, get attr from fifo */
> CHR, /* case 01, get attr from char special */
> @@ -150,3 +153,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/setxattr/setxattr01.c b/testcases/kernel/syscalls/setxattr/setxattr01.c
> index fedb777..425fcf3 100644
> --- a/testcases/kernel/syscalls/setxattr/setxattr01.c
> +++ b/testcases/kernel/syscalls/setxattr/setxattr01.c
> @@ -43,10 +43,10 @@
> * setxattr(2) should succeed
> */
>
> +#include "config.h"
> #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>
> @@ -54,10 +54,15 @@
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> -
> +#ifdef HAVE_ATTR_XATTR_H
> +#include <attr/xattr.h>
> +#endif
> #include "test.h"
> #include "usctest.h"
>
> +char *TCID = "setxattr01";
> +
> +#ifdef HAVE_ATTR_XATTR_H
> #define XATTR_NAME_MAX 255
> #define XATTR_NAME_LEN (XATTR_NAME_MAX + 2)
> #define XATTR_SIZE_MAX 65536
> @@ -68,7 +73,6 @@
> static void setup(void);
> static void cleanup(void);
>
> -char *TCID = "setxattr01";
> char filename[BUFSIZ];
> char long_key[XATTR_NAME_LEN];
> char *long_value;
> @@ -221,3 +225,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/setxattr/setxattr02.c b/testcases/kernel/syscalls/setxattr/setxattr02.c
> index f4ba566..465796c 100644
> --- a/testcases/kernel/syscalls/setxattr/setxattr02.c
> +++ b/testcases/kernel/syscalls/setxattr/setxattr02.c
> @@ -42,10 +42,10 @@
> * return -1 and set errno to EPERM
> */
>
> +#include "config.h"
> #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>
> @@ -53,10 +53,15 @@
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> -
> +#ifdef HAVE_ATTR_XATTR_H
> +#include <attr/xattr.h>
> +#endif
> #include "test.h"
> #include "usctest.h"
>
> +char *TCID = "setxattr02";
> +
> +#ifdef HAVE_ATTR_XATTR_H
> #define XATTR_TEST_KEY "user.testkey"
> #define XATTR_TEST_VALUE "this is a test value"
> #define XATTR_TEST_VALUE_SIZE 20
> @@ -72,8 +77,6 @@
> static void setup(void);
> static void cleanup(void);
>
> -char *TCID = "setxattr02";
> -
> struct test_case {
> char *fname;
> char *key;
> @@ -233,3 +236,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
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LTP] [PATCH v2] syscalls/xattr: fix compile when xattr.h not exist
2012-01-10 3:01 ` [LTP] [PATCH v2] " Caspar Zhang
2012-01-10 3:30 ` Eryu Guan
@ 2012-01-11 15:24 ` Cyril Hrubis
1 sibling, 0 replies; 11+ messages in thread
From: Cyril Hrubis @ 2012-01-11 15:24 UTC (permalink / raw)
To: Caspar Zhang; +Cc: LTP List
Hi!
> if <attr/xattr.h> doesn't exist, compliation will fail. Fix it in
> autotools level.
>
> Signed-off-by: Caspar Zhang <caspar@casparzhang.com>
> ---
> configure.ac | 1 +
> testcases/kernel/syscalls/getxattr/getxattr01.c | 16 +++++++++++++---
> testcases/kernel/syscalls/getxattr/getxattr02.c | 17 +++++++++++++----
> testcases/kernel/syscalls/setxattr/setxattr01.c | 16 +++++++++++++---
> testcases/kernel/syscalls/setxattr/setxattr02.c | 17 +++++++++++++----
> 5 files changed, 53 insertions(+), 14 deletions(-)
Commited, thanks!
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-01-11 15:13 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.