fix SEEK_END bug in lseek.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@185 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
4edb72147b
commit
809310e6b2
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue