Daniel Gollub wrote:
> On Wednesday 22 October 2008 15:35:12 Daniel Gollub wrote:
>> On Wednesday 22 October 2008 15:18:33 Subrata Modak wrote:
>>> Is there any way by which this can be fixed ?
>> I'll have a quick look on this ....
>>
>> (some question below)
>>
>>> Regards--
>>> Subrata
>>>
>>> On Mon, 2008-10-20 at 15:31 +0530, Subrata Modak wrote:
>>>> Hi Daniel,
>>>>
>>>> On Mon, 2008-10-20 at 11:36 +0200, Daniel Gollub wrote:
>>>>> On Monday 20 October 2008 11:22:57 Subrata Modak wrote:
>>>>>> I found some compilation errors for the connectors at today´s CVS
>>>>>> snapshot on the following machine. Can you please look into this:
>>>>>>
>>>>>> 1) uname -a
>>>>>> Linux 2.6.27-autokern1 #1 SMP Mon Oct 20 00:45:37 PDT 2008 i686
>>>>>> GNU/Linux
>> You're running 2.6.27 ...
>>
>>>>>>
>>>>>> # gcc --version
>>>>>> gcc (GCC) 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)
>>>>>>
>>>>>>
>>>>>> cc -Wall  -I../../../../include -Wall    pec_listener.c
>>>>>> -L../../../../lib -lltp -o pec_listener
>>>>>> pec_listener.c:33:29: error: linux/connector.h: No such file or
>>>>>> directory
>>>>>> pec_listener.c:35:27: error: linux/cn_proc.h: No such file or directory
>>>>> [...]
>> ... but do you don't have the 2.6.27 kernel headers installed - right?
>>
>> Trying to find out when connector.h and cn_proc.h  got introduced
>> and installed as linux-kernel-headers....
> 
> Whats the version of you linux kernel-headers on this system?
> 
> I just checked lxr - it looks like linux/connector.h got introduced
> with 2.6.14 and linux/cn_proc.h with 2.6.15.
> 
> Do you have earlier version of the headers then 2.6.14 installed on this
> system?
> 
> I guess  we have to do the build conditional to (< 2.6.15)...
> 

How about:

check if NETLINK_CONNECTOR is defined (in netlink.h). If not, we can't
include connector.h, so we break the test. If yes, we check if CN_IDX_PROC
is defined. Subrata, can you try the following patch?

Signed-off-by: Li Zefan <[EMAIL PROTECTED]>

--- a/testcases/kernel/connectors/pec/pec_listener.c
+++ b/testcases/kernel/connectors/pec/pec_listener.c
@@ -30,7 +30,27 @@
 #include <sys/poll.h>
 
 #include <linux/netlink.h>
+
+#ifndef NETLINK_CONNECTOR
+
+int main(void)
+{
+       return 2;
+}
+
+#else
+
 #include <linux/connector.h>
+
+#ifndef CN_IDX_PROC
+
+int main(void)
+{
+       return 2;
+}
+
+#else
+
 #define _LINUX_TIME_H
 #include <linux/cn_proc.h>
 
@@ -315,3 +333,7 @@ int main(int argc, char **argv)
        return 0;
 }
 
+#endif /* CN_IDX_PROC */
+
+#endif /* NETLINK_CONNECTOR */
+
--- a/testcases/kernel/connectors/pec/run_pec_test
+++ b/testcases/kernel/connectors/pec/run_pec_test
@@ -77,6 +76,11 @@ run_case()
                return 1
        fi
 
+       if [ $ret2 -eq 2 ]; then
+               tst_brkm TBROK NULL "connector may not be supported"
+               exit 0
+       fi
+
        if [ $ret2 -ne 0 ]; then
                tst_resm TFAIL "failed to listen process events"
                exit_status=1


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to