mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 07:59:42 +00:00
Replace pread() in lseek()+read()
Signed-off-by: Saggi Mizrahi <ficoos@gmail.com>
This commit is contained in:
parent
32aac90e10
commit
1c37ef4158
@ -129,7 +129,8 @@ static int detect_ps1_game(const char* track_path, int32_t offset,
|
||||
return -errno;
|
||||
}
|
||||
|
||||
if (pread(fd, buff, 10, 0x9340) > 0) {
|
||||
lseek(fd, 0x9340, SEEK_SET);
|
||||
if (read(fd, buff, 10) > 0) {
|
||||
buff[10] = '\0';
|
||||
buff[4] = '-';
|
||||
LOG_DEBUG("Found disk label '%s'", buff);
|
||||
@ -200,7 +201,8 @@ static int detect_system(const char* track_path, int32_t offset,
|
||||
goto clean;
|
||||
}
|
||||
|
||||
if (pread(fd, magic, MAGIC_LEN, offset) < MAGIC_LEN) {
|
||||
lseek(fd, offset, SEEK_SET);
|
||||
if (read(fd, magic, MAGIC_LEN) < MAGIC_LEN) {
|
||||
LOG_WARN("Could not read data from file '%s' at offset %d: %s",
|
||||
track_path, offset, strerror(errno));
|
||||
rv = -errno;
|
||||
|
Loading…
Reference in New Issue
Block a user