X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/102b0fcc467c77d0a8f82cfee060353e3cf17261..c6d6f58c34e1b6a4c03d1e86d1abf48eeb6f5624:/lincan/src/write.c diff --git a/lincan/src/write.c b/lincan/src/write.c index 2f32b2e..1869c97 100644 --- a/lincan/src/write.c +++ b/lincan/src/write.c @@ -7,16 +7,8 @@ * Version lincan-0.2 9 Jul 2003 */ -#include - -#define __NO_VERSION__ -#include -#include -#include -#include -#include -#include - +#include "../include/can.h" +#include "../include/can_sysdep.h" #include "../include/main.h" ssize_t can_write(struct file *file, const char *buffer, size_t length, loff_t *offset) @@ -70,11 +62,12 @@ ssize_t can_write(struct file *file, const char *buffer, size_t length, loff_t * if ((ret=canque_get_inslot4id(qends, &qedge, &slot, 0, msg_buff.id, 0))<0){ DEBUGMSG("Buffer is full\n"); - if (file->f_flags & O_NONBLOCK) - return -EAGAIN; if(ret < -1) return -EIO; + if (file->f_flags & O_NONBLOCK) + return -EAGAIN; + ret=canque_get_inslot4id_wait_kern(qends, &qedge, &slot, 0, msg_buff.id, 0); if(ret<0) {