Update of /cvsroot/libsysio/libsysio/drivers/native
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186/drivers/native
Modified Files:
Tag: LLNL_HPSS
fs_native.c
Log Message:
POSIX defines the ioctl request to be of type `int' and not `unsigned long int'
as we had it. Fixed.
Index: fs_native.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v
retrieving revision 1.56
retrieving revision 1.56.2.1
diff -u -w -b -B -p -r1.56 -r1.56.2.1
--- fs_native.c 4 Aug 2005 20:17:09 -0000 1.56
+++ fs_native.c 6 Sep 2005 14:35:32 -0000 1.56.2.1
@@ -197,7 +197,7 @@ static int native_inop_fcntl(struct inod
static int native_inop_sync(struct inode *ino);
static int native_inop_datasync(struct inode *ino);
static int native_inop_ioctl(struct inode *ino,
- unsigned long int request,
+ int request,
va_list ap);
static int native_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev);
#ifdef _HAVE_STATVFS
@@ -1742,12 +1742,11 @@ native_inop_datasync(struct inode *ino)
#ifdef HAVE_LUSTRE_HACK
static int
-native_inop_ioctl(struct inode *ino,
- unsigned long int request,
- va_list ap)
+native_inop_ioctl(struct inode *ino, int request, va_list ap)
{
struct native_inode *nino;
long arg1, arg2, arg3, arg4;
+ int err;
nino = I2NI(ino);
assert(nino->ni_fd >= 0);
@@ -1756,21 +1755,29 @@ 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,
+ err =
+ syscall(SYSIO_SYS_ioctl,
+ I2NI(ino)->ni_fd,
+#if SYSIO_USE_BSD_IOCTL
+ (unsigned long int)
+#endif
+ request,
arg1, arg2, arg3, arg4);
+ if (err < 0)
+ err = -errno;
+ return err;
}
#else
static int
native_inop_ioctl(struct inode *ino __IS_UNUSED,
- unsigned long int request __IS_UNUSED,
+ int request __IS_UNUSED,
va_list ap __IS_UNUSED)
{
/*
* I'm lazy. Maybe implemented later.
*/
- errno = ENOTTY;
- return -1;
+ return -ENOTTY;
}
#endif
|