]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/close.c
Added support for fasync system call and replacement of spinXXX by can_spinXXX
[lincan.git] / lincan / src / close.c
index c42869e147355cd3f48b3f554736136b75431e9d..4df1533e9fa283dba8228f71a35c4a4d47c2eea3 100644 (file)
@@ -13,6 +13,7 @@
 #include "../include/close.h"
 #include "../include/i82527.h"
 #include "../include/setup.h"
 #include "../include/close.h"
 #include "../include/i82527.h"
 #include "../include/setup.h"
+#include "../include/fasync.h"
 
 #define __NO_VERSION__
 #include <linux/module.h>
 
 #define __NO_VERSION__
 #include <linux/module.h>
@@ -31,6 +32,12 @@ int can_close(struct inode *inode, struct file *file)
        obj = canuser->msgobj;
        qends = canuser->qends;
 
        obj = canuser->msgobj;
        qends = canuser->qends;
 
+    #ifdef CAN_ENABLE_KERN_FASYNC
+
+       can_fasync(-1, file, 0);
+
+    #endif /*CAN_ENABLE_KERN_FASYNC*/
+
        list_del(&canuser->peers);
        canuser->qends = NULL;
        canqueue_ends_dispose_kern(qends, file->f_flags & O_SYNC);
        list_del(&canuser->peers);
        canuser->qends = NULL;
        canqueue_ends_dispose_kern(qends, file->f_flags & O_SYNC);
@@ -42,8 +49,8 @@ int can_close(struct inode *inode, struct file *file)
                /* FIXME: what about clearing chip HW status, stopping sending messages etc? */
        };
        
                /* FIXME: what about clearing chip HW status, stopping sending messages etc? */
        };
        
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,50))
+    #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,50))
        MOD_DEC_USE_COUNT;
        MOD_DEC_USE_COUNT;
-#endif
+    #endif
        return 0;
 }
        return 0;
 }