[libc] [Obvious] Cleanup.

+ Avoid the `clockid` var and just passed `long(CLOCK_REALTIME)`
  to the syscall.

Reviewed By: rtenneti

Differential Revision: https://reviews.llvm.org/D138070
This commit is contained in:
Raman Tenneti 2022-11-15 15:26:36 -08:00
parent 4bc86ae83e
commit 191ab4f46e
1 changed files with 3 additions and 4 deletions

View File

@ -20,11 +20,10 @@ LLVM_LIBC_FUNCTION(int, gettimeofday,
(struct timeval * tv, [[maybe_unused]] void *unused)) {
if (tv == nullptr)
return 0;
clockid_t clockid = CLOCK_REALTIME;
struct timespec tp;
long ret_val =
__llvm_libc::syscall_impl(SYS_clock_gettime, static_cast<long>(clockid),
reinterpret_cast<long>(&tp));
long ret_val = __llvm_libc::syscall_impl(SYS_clock_gettime,
static_cast<long>(CLOCK_REALTIME),
reinterpret_cast<long>(&tp));
// A negative return value indicates an error with the magnitude of the
// value being the error code.
if (ret_val < 0) {