mirror of
https://github.com/apache/nuttx.git
synced 2026-08-26 11:50:50 +00:00
First pread/pwrite typo fixes
This commit is contained in:
parent
884ab0500c
commit
6d33cd329d
2 changed files with 4 additions and 4 deletions
|
|
@ -101,7 +101,7 @@ ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset)
|
|||
|
||||
/* Then seek to the correct position in the file */
|
||||
|
||||
pos = lseek(fd, offset, SEEK_CUR);
|
||||
pos = lseek(fd, offset, SEEK_SET);
|
||||
if (pos == (off_t)-1)
|
||||
{
|
||||
/* This might fail is the offset is beyond the end of file */
|
||||
|
|
@ -116,7 +116,7 @@ ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset)
|
|||
|
||||
/* Restore the file position */
|
||||
|
||||
pos = lseek(fd, savepos, SEEK_CUR);
|
||||
pos = lseek(fd, savepos, SEEK_SET);
|
||||
if (pos == (off_t)-1 && ret >= 0)
|
||||
{
|
||||
/* This really should not fail */
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset)
|
|||
|
||||
/* Then seek to the correct position in the file */
|
||||
|
||||
pos = lseek(fd, offset, SEEK_CUR);
|
||||
pos = lseek(fd, offset, SEEK_SET);
|
||||
if (pos == (off_t)-1)
|
||||
{
|
||||
/* This might fail is the offset is beyond the end of file */
|
||||
|
|
@ -114,7 +114,7 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset)
|
|||
|
||||
/* Restore the file position */
|
||||
|
||||
pos = lseek(fd, savepos, SEEK_CUR);
|
||||
pos = lseek(fd, savepos, SEEK_SET);
|
||||
if (pos == (off_t)-1 && ret >= 0)
|
||||
{
|
||||
/* This really should not fail */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue