From b7de679b2fa29a1f4eeb7c8071e5436d2e24e5e1 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sun, 16 Feb 2003 16:45:13 +0000 Subject: [PATCH] fixed setting of __comedi_errno after ioctl --- lib/ioctl.c | 11 ++++++++++- lib/libinternal.h | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/ioctl.c b/lib/ioctl.c index cdcb9ad..b0dd2f6 100644 --- a/lib/ioctl.c +++ b/lib/ioctl.c @@ -38,13 +38,22 @@ /* ioctl wrappers */ +int _comedi_ioctl( int fd, int request, unsigned long arg ) +{ + int ret; + + ret = ioctl( fd, request, arg ); + if( ret < 0 ) + libc_error(); + return ret; +} int _comedi_ioctl_debug(int fd, int request, unsigned long arg) { int ret; fprintf(stderr,"ioctl(%d,0x%08x,0x%08lx) = ",fd,request,arg); - ret = ioctl(fd,request,arg); + ret = _comedi_ioctl(fd,request,arg); fprintf(stderr,"%d\n",ret); return ret; diff --git a/lib/libinternal.h b/lib/libinternal.h index 36e0eec..8617334 100644 --- a/lib/libinternal.h +++ b/lib/libinternal.h @@ -126,10 +126,10 @@ struct subdevice_struct{ comedi_cmd *cmd_timed; }; - -#define comedi_ioctl ioctl +#define comedi_ioctl _comedi_ioctl //#define comedi_ioctl _comedi_ioctl_debug +int _comedi_ioctl( int fd, int request, unsigned long arg ); int _comedi_ioctl_debug(int,int,unsigned long); /* filler routines */ -- 2.26.2