summaryrefslogtreecommitdiff
path: root/libdiskfs/io-seek.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-02-04 21:35:23 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-02-04 21:35:23 +0000
commitc5e1bff6f39f3bd3dc972f55da75ba294baef802 (patch)
treec8f49b3dc6bfbccec8cba35490673463ca2c7253 /libdiskfs/io-seek.c
parentd9c156d1846813eb849b4678244408da1e84e412 (diff)
Formerly io-seek.c.~3~
Diffstat (limited to 'libdiskfs/io-seek.c')
-rw-r--r--libdiskfs/io-seek.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/libdiskfs/io-seek.c b/libdiskfs/io-seek.c
index f17bc04b..7a27da1d 100644
--- a/libdiskfs/io-seek.c
+++ b/libdiskfs/io-seek.c
@@ -17,6 +17,7 @@
#include "priv.h"
#include "io_S.h"
+#include <unistd.h>
#define diskfs_readonly 0
@@ -28,26 +29,28 @@ diskfs_S_io_seek (struct protid *cred,
off_t *newoffset)
{
- CHANGE_IP_FIELD (cred,
+ CHANGE_NODE_FIELD (cred,
({
- err = ioserver_get_conch (&np->i_conch);
- if (!err)
- switch (whence)
- {
- case SEEK_SET:
- cred->po->filepointer = offset;
- break;
- case SEEK_CUR:
- cred->po->filepointer += offset;
- break;
- case SEEK_END:
- cred->po->filepointer = (np->dn_stat.st_size
- + offset);
- break;
- default:
- err = EINVAL;
- break;
- }
+ ioserver_get_conch (&np->conch);
+ switch (whence)
+ {
+ case SEEK_SET:
+ err = 0;
+ cred->po->filepointer = offset;
+ break;
+ case SEEK_CUR:
+ err = 0;
+ cred->po->filepointer += offset;
+ break;
+ case SEEK_END:
+ err = 0;
+ cred->po->filepointer = (np->dn_stat.st_size
+ + offset);
+ break;
+ default:
+ err = EINVAL;
+ break;
+ }
*newoffset = cred->po->filepointer;
}));
}