diff options
author | Brandon Potter <brandon.potter@amd.com> | 2016-03-17 10:22:39 -0700 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2016-03-17 10:22:39 -0700 |
commit | c05fa167295864d50d460f0d92dbe0aa91a4f220 (patch) | |
tree | 501c903b18b3957b953e76422841c23d9266c8a8 /src/sim/syscall_emul.cc | |
parent | c47cf3ec205142b6c0cc726ec2ebe169ad2f7b31 (diff) | |
download | gem5-c05fa167295864d50d460f0d92dbe0aa91a4f220.tar.xz |
syscall_emul, style: refactor lseek
Diffstat (limited to 'src/sim/syscall_emul.cc')
-rw-r--r-- | src/sim/syscall_emul.cc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 3dda05da7..a3acae19d 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -306,19 +306,13 @@ _llseekFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) uint64_t result = lseek(sim_fd, offset, whence); result = TheISA::htog(result); - if (result == (off_t)-1) { - //The seek failed. + if (result == (off_t)-1) return -errno; - } else { - // The seek succeeded. - // Copy "result" to "result_ptr" - // XXX We'll assume that the size of loff_t is 64 bits on the - // target platform - BufferArg result_buf(result_ptr, sizeof(result)); - memcpy(result_buf.bufferPtr(), &result, sizeof(result)); - result_buf.copyOut(tc->getMemProxy()); - return 0; - } + // Assuming that the size of loff_t is 64 bits on the target platform + BufferArg result_buf(result_ptr, sizeof(result)); + memcpy(result_buf.bufferPtr(), &result, sizeof(result)); + result_buf.copyOut(tc->getMemProxy()); + return 0; } |