mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
First pread/pwrite typo fixes
This commit is contained in:
+2
-2
@@ -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 */
|
/* 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)
|
if (pos == (off_t)-1)
|
||||||
{
|
{
|
||||||
/* This might fail is the offset is beyond the end of file */
|
/* 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 */
|
/* Restore the file position */
|
||||||
|
|
||||||
pos = lseek(fd, savepos, SEEK_CUR);
|
pos = lseek(fd, savepos, SEEK_SET);
|
||||||
if (pos == (off_t)-1 && ret >= 0)
|
if (pos == (off_t)-1 && ret >= 0)
|
||||||
{
|
{
|
||||||
/* This really should not fail */
|
/* This really should not fail */
|
||||||
|
|||||||
+2
-2
@@ -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 */
|
/* 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)
|
if (pos == (off_t)-1)
|
||||||
{
|
{
|
||||||
/* This might fail is the offset is beyond the end of file */
|
/* 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 */
|
/* Restore the file position */
|
||||||
|
|
||||||
pos = lseek(fd, savepos, SEEK_CUR);
|
pos = lseek(fd, savepos, SEEK_SET);
|
||||||
if (pos == (off_t)-1 && ret >= 0)
|
if (pos == (off_t)-1 && ret >= 0)
|
||||||
{
|
{
|
||||||
/* This really should not fail */
|
/* This really should not fail */
|
||||||
|
|||||||
Reference in New Issue
Block a user