]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
Use send_sig() instead of kill_proc() in emulated kthread support.
authorppisa <ppisa>
Sun, 2 Nov 2008 12:35:20 +0000 (12:35 +0000)
committerppisa <ppisa>
Sun, 2 Nov 2008 12:35:20 +0000 (12:35 +0000)
This allows to compile driver on latest 2.6.27+ kernels,
but is incorrect anyway. The local code for kernel thread
support is not more needed for recent 2.6 kernels and code
should be modified to emulate same interface for older ones.

lincan/src/kthread.c

index ae43c306384a88f8878fda263d3c9f515449f6e0..a1563cebead4215c2402ce42537e4304b937322a 100644 (file)
@@ -118,7 +118,13 @@ void stop_kthread(kthread_t *kthread)
        the flags are visible on all CPUs.
     */
     mb();
+#warning The local code for kernel thread support is not more needed for recent 2.6 kernels
+#warning and code should be modified to emulate same interface for older kernels
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
     kill_proc(kthread->thread->pid, SIGKILL, 1);
+#else /* >= 2,6,20 */
+    send_sig(SIGKILL, kthread->thread, 1);
+#endif /* >= 2,6,20 */
 
     /* block till thread terminated */
     down(&kthread->startstop_sem);
@@ -129,7 +135,9 @@ void stop_kthread(kthread_t *kthread)
     /* now we are sure the thread is in zombie state. We
        notify keventd to clean the process up.
     */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
     kill_proc(2, SIGCHLD, 1);
+#endif /* >= 2,6,20 */
 
 }