summaryrefslogtreecommitdiff
path: root/filesystem
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2009-12-01 15:27:56 +0000
committerbernard.xiong <[email protected]>2009-12-01 15:27:56 +0000
commit809310e6b2d0902973677ecf700b4433547fb84e (patch)
tree079bbd258536ebde37bdcfee571e064b37ccece3 /filesystem
parent4edb72147bd84b78b435d15cdcf304442f71ec13 (diff)
fix SEEK_END bug in lseek.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@185 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'filesystem')
-rw-r--r--filesystem/dfs/src/dfs_posix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/filesystem/dfs/src/dfs_posix.c b/filesystem/dfs/src/dfs_posix.c
index 96ae60e7fb..4780cdec2a 100644
--- a/filesystem/dfs/src/dfs_posix.c
+++ b/filesystem/dfs/src/dfs_posix.c
@@ -174,7 +174,7 @@ int write(int fd, char *buf, int len)
|
+------------------------------------------------------------------------------
*/
-int lseek(int fd, int offset, int dir)
+int lseek(int fd, int offset, int dir)
{
int result;
struct dfs_fd* d;
@@ -196,7 +196,7 @@ int lseek(int fd, int offset, int dir)
break;
case DFS_SEEK_END:
- offset = d->pos - offset;
+ offset += d->size;
break;
}
@@ -210,7 +210,7 @@ int lseek(int fd, int offset, int dir)
/* release the ref-count of fd */
fd_put(d);
- return result;
+ return offset;
}
/*