[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2005-10-19 19:25:41
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2498 Modified Files: fs_native.c Log Message: Fix returns from ioctl in both the normal ioctl handler and the one defined when WITH_LUSTRE_HACK set. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -w -b -B -p -r1.56 -r1.57 --- fs_native.c 4 Aug 2005 20:17:09 -0000 1.56 +++ fs_native.c 19 Oct 2005 19:25:33 -0000 1.57 @@ -1748,6 +1748,7 @@ native_inop_ioctl(struct inode *ino, { struct native_inode *nino; long arg1, arg2, arg3, arg4; + int rtn; nino = I2NI(ino); assert(nino->ni_fd >= 0); @@ -1756,8 +1757,12 @@ native_inop_ioctl(struct inode *ino, arg3 = va_arg(ap, long); arg4 = va_arg(ap, long); - return syscall(SYSIO_SYS_ioctl, I2NI(ino)->ni_fd, request, + rtn = + syscall(SYSIO_SYS_ioctl, I2NI(ino)->ni_fd, request, arg1, arg2, arg3, arg4); + if (rtn < 0) + rtn = -errno; + return rtn; } #else static int @@ -1769,8 +1774,7 @@ native_inop_ioctl(struct inode *ino __IS /* * I'm lazy. Maybe implemented later. */ - errno = ENOTTY; - return -1; + return -ENOTTY; } #endif |