Update of /cvsroot/libsysio/libsysio/drivers/yod
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15431/drivers/yod
Modified Files:
Tag: namespace_assembly
fs_yod.c
Log Message:
Bring in changes from the HEAD.
Index: fs_yod.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -w -b -B -p -r1.8 -r1.8.2.1
--- fs_yod.c 12 Nov 2003 21:51:40 -0000 1.8
+++ fs_yod.c 28 Jan 2004 13:16:56 -0000 1.8.2.1
@@ -808,7 +808,7 @@ yod_inop_symlink(struct pnode *pno, cons
if (!path)
return -ENOMEM;
- err = symlink_yod(path, data);
+ err = symlink_yod(data, path);
free(path);
return err;
}
@@ -987,7 +987,11 @@ doio(ssize_t (*f)(int, const struct iove
assert(nino->ni_fd >= 0);
- if (ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 0)
+ if ((ioctx->ioctx_iovlen && (int )ioctx->ioctx_iovlen < 0) ||
+ !(S_ISREG(ino->i_mode) ||
+ S_ISCHR(ino->i_mode) ||
+ S_ISSOCK(ino->i_mode) ||
+ S_ISFIFO(ino->i_mode)))
return -EINVAL;
/*
@@ -1002,30 +1006,29 @@ doio(ssize_t (*f)(int, const struct iove
* Avoid the reposition call if we're already at the right place.
* Allows us to access pipes and fifos.
*/
- result = nino->ni_fpos;
- if (ioctx->ioctx_offset != nino->ni_fpos &&
- !(S_ISCHR(ino->i_mode) ||
- S_ISSOCK(ino->i_mode) ||
- S_ISFIFO(ino->i_mode)) &&
- (result = lseek_yod(nino->ni_fd,
+ result = ioctx->ioctx_offset;
+ if (ioctx->ioctx_offset != nino->ni_fpos) {
+ result = lseek_yod(nino->ni_fd,
ioctx->ioctx_offset,
- SEEK_SET) == -1)) {
+ SEEK_SET);
+ if (result == -1) {
ioctx->ioctx_cc = -1;
ioctx->ioctx_errno = errno;
- } else {
+ goto out;
+ }
+ nino->ni_fpos = result;
+ }
/*
* Call the appropriate (read/write) IO function to
* transfer the data now.
*/
- nino->ni_fpos = result;
ioctx->ioctx_cc =
(*f)(nino->ni_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen);
if (ioctx->ioctx_cc < 0)
ioctx->ioctx_errno = errno;
if (ioctx->ioctx_cc > 0)
nino->ni_fpos += ioctx->ioctx_cc;
- }
-
+out:
ioctx->ioctx_done = 1;
return 0;
}
|