Skip to content

Commit e99ed67

Browse files
andreafioraldiaurelf
authored andcommitted
Fixed deprecated stime() usage in syscall
From AFLplusplus 6e8f249
1 parent fa59c03 commit e99ed67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

linux-user/syscall.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7664,10 +7664,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
76647664
#ifdef TARGET_NR_stime /* not on alpha */
76657665
case TARGET_NR_stime:
76667666
{
7667-
time_t host_time;
7668-
if (get_user_sal(host_time, arg1))
7667+
struct timespec ts;
7668+
ts.tv_nsec = 0;
7669+
if (get_user_sal(ts.tv_sec, arg1)) {
76697670
return -TARGET_EFAULT;
7670-
return get_errno(stime(&host_time));
7671+
}
7672+
return get_errno(clock_settime(CLOCK_REALTIME, &ts));
76717673
}
76727674
#endif
76737675
#ifdef TARGET_NR_alarm /* not on alpha */

0 commit comments

Comments
 (0)