# HG changeset patch # User etisserant # Date 1212569949 -7200 # Node ID bea45a091214625a1881589b231dd24043a48614 # Parent 86ff6646b721db75a3e3a780add1c5ea8ec3aaf8 Applied James patch that fixes can_cn4linux.c file descriptor handling and make it compatible with can_serial_hub. diff -r 86ff6646b721 -r bea45a091214 drivers/can_can4linux/can_can4linux.c --- a/drivers/can_can4linux/can_can4linux.c Wed Jun 04 10:57:56 2008 +0200 +++ b/drivers/can_can4linux/can_can4linux.c Wed Jun 04 10:59:09 2008 +0200 @@ -168,7 +168,7 @@ dev_name[prefix_len+name_len] = 0; fd0 = open(dev_name, O_RDWR|o_flags); - if(fd0 <= 0){ + if(fd0 == -1){ fprintf(stderr,"!!! %s is unknown. See can4linux.c\n", dev_name); goto error_ret; } @@ -192,8 +192,16 @@ /***************************************************************************/ int canClose_driver(CAN_HANDLE fd0) { - if((int)fd0<=0) - return -1; - close(fd0); - return 0; -} + if((int)fd0 != -1) { + return close((int)fd0); + } + + return -1; +} + +int canfd_driver(CAN_HANDLE fd0) +{ + return ((int)fd0); +} + +