1384
return -TARGET_EFAULT;
1385
if (efd_addr && copy_to_user_fdset(efd_addr, &efds, n))
1386
return -TARGET_EFAULT;
1387
-
1388
- if (target_tv_addr) {
1389
- tv.tv_sec = ts.tv_sec;
1390
- tv.tv_usec = ts.tv_nsec / 1000;
1391
- if (copy_to_user_timeval(target_tv_addr, &tv)) {
1392
- return -TARGET_EFAULT;
1393
- }
1394
- }
1387
+ }
1388
+ if (target_tv_addr) {
1389
+ tv.tv_sec = ts.tv_sec;
1390
+ tv.tv_usec = ts.tv_nsec / 1000;
1391
+ /*
1392
+ * Like the kernel, we deliberately ignore possible
1393
+ * failures writing back to the timeout struct.
1394
+ */
1395
+ copy_to_user_timeval(target_tv_addr, &tv);
1396
}
1397
1398
return ret;
1520
if (efd_addr && copy_to_user_fdset(efd_addr, &efds, n)) {
1521
return -TARGET_EFAULT;
1522
}
1523
+ }
1524
+ if (ts_addr) {
1525
+ /*
1526
+ * Like the kernel, we deliberately ignore possible
1527
+ * failures writing back to the timeout struct.
1528
+ */
1529
if (time64) {
1523
- if (ts_addr && host_to_target_timespec64(ts_addr, &ts)) {
1524
- return -TARGET_EFAULT;
1525
- }
1530
+ host_to_target_timespec64(ts_addr, &ts);
1531
} else {
1527
- if (ts_addr && host_to_target_timespec(ts_addr, &ts)) {
1528
- return -TARGET_EFAULT;
1529
- }
1532
+ host_to_target_timespec(ts_addr, &ts);
1533
}
1534
}
1535
return ret;
1599
if (set) {
1600
finish_sigsuspend_mask(ret);
1601
}
1599
- if (!is_error(ret) && arg3) {
1602
+ if (arg3) {
1603
+ /*
1604
+ * Like the kernel, we deliberately ignore possible
1605
+ * failures writing back to the timeout struct.
1606
+ */
1607
if (time64) {
1601
- if (host_to_target_timespec64(arg3, timeout_ts)) {
1602
- return -TARGET_EFAULT;
1603
- }
1608
+ host_to_target_timespec64(arg3, timeout_ts);
1609
} else {
1605
- if (host_to_target_timespec(arg3, timeout_ts)) {
1606
- return -TARGET_EFAULT;
1607
- }
1610
+ host_to_target_timespec(arg3, timeout_ts);
1611
}
1612
}
1613
} else {