Skip to contentSkip to conversation

Use present autoconf test for asm/ldt.h in set_thread_area* tests to prevent build failures

PATCH Mike Frysinger 2 participants 2 messages Jun 23, 2009 – Jun 25, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 21 lines · On Friday 19 June 2009 10:12:15 Jiri Palecek > wrote:
(quoted diff) +0 -8
-#include <stdio.h>
-#include <errno.h>
-#include <linux/unistd.h>
-#include <asm/ldt.h>
-
 /* Harness Specific Include Files. */
 #include "test.h"
 #include "usctest.h"
 #include "linux_syscall_numbers.h"
-
-/* Extern Global Variables */
-extern int Tst_count;           /* counter for tst_xxx routines.        

*/ -extern char *TESTDIR; /* temporary dir created by
tst_tmpdir() */ +#include "config.h"

/* Global Variables */
char *TCID = "set_thread_area01"; /* Test program identifier.*/ int testno;
int TST_TOTAL = 2; /* total number of tests in this
file. */

Review

Quoted 5 lines
(quoted diff) +5 -0
+#if defined HAVE_ASM_LDT_H
+#include <stdio.h>
+#include <errno.h>
+#include <linux/unistd.h>
+#include <asm/ldt.h>

moving asm/ldt.h behind the ifdef makes sense, but none of the others do. there is no point in delaying the other includes and in general, all includes should come first ... there shouldnt be definitions before them. less likely to get bitten in the ass with clashes.
-mike

------------------------------------------------------------------------------

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 22 lines · Mike Frysinger
Quoted 21 lines · On Friday 19 June 2009 10:12:15 Jiri Palecek > wrote:
(quoted diff) +0 -8
-#include <stdio.h>
-#include <errno.h>
-#include <linux/unistd.h>
-#include <asm/ldt.h>
-
 /* Harness Specific Include Files. */
 #include "test.h"
 #include "usctest.h"
 #include "linux_syscall_numbers.h"
-
-/* Extern Global Variables */
-extern int Tst_count;           /* counter for tst_xxx routines.        

*/ -extern char *TESTDIR; /* temporary dir created by
tst_tmpdir() */ +#include "config.h"

/* Global Variables */
char *TCID = "set_thread_area01"; /* Test program identifier.*/ int testno;
int TST_TOTAL = 2; /* total number of tests in this
file. */

Quoted 10 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+#if defined HAVE_ASM_LDT_H
+#include <stdio.h>
+#include <errno.h>
+#include <linux/unistd.h>
+#include <asm/ldt.h>

moving asm/ldt.h behind the ifdef makes sense, but none of the others do. there is no point in delaying the other includes and in general, all includes should come first ... there shouldnt be definitions before them. less likely to get bitten in the ass with clashes.

Correct. I did this for Jiri.

Regards--
Subrata

Quoted 6 lines

-mike
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list