diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
commit | 1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch) | |
tree | 47da3feee8e263e8c9352c85cf518e624be3c211 /tools/testing/selftests/timers/set-timer-lat.c | |
parent | 750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff) | |
parent | 8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff) |
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/timers/set-timer-lat.c')
-rw-r--r-- | tools/testing/selftests/timers/set-timer-lat.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing/selftests/timers/set-timer-lat.c index 9c92b7bd5641..50da45437daa 100644 --- a/tools/testing/selftests/timers/set-timer-lat.c +++ b/tools/testing/selftests/timers/set-timer-lat.c | |||
@@ -143,7 +143,8 @@ int setup_timer(int clock_id, int flags, int interval, timer_t *tm1) | |||
143 | printf("%-22s %s missing CAP_WAKE_ALARM? : [UNSUPPORTED]\n", | 143 | printf("%-22s %s missing CAP_WAKE_ALARM? : [UNSUPPORTED]\n", |
144 | clockstring(clock_id), | 144 | clockstring(clock_id), |
145 | flags ? "ABSTIME":"RELTIME"); | 145 | flags ? "ABSTIME":"RELTIME"); |
146 | return 0; | 146 | /* Indicate timer isn't set, so caller doesn't wait */ |
147 | return 1; | ||
147 | } | 148 | } |
148 | printf("%s - timer_create() failed\n", clockstring(clock_id)); | 149 | printf("%s - timer_create() failed\n", clockstring(clock_id)); |
149 | return -1; | 150 | return -1; |
@@ -213,8 +214,9 @@ int do_timer(int clock_id, int flags) | |||
213 | int err; | 214 | int err; |
214 | 215 | ||
215 | err = setup_timer(clock_id, flags, interval, &tm1); | 216 | err = setup_timer(clock_id, flags, interval, &tm1); |
217 | /* Unsupported case - return 0 to not fail the test */ | ||
216 | if (err) | 218 | if (err) |
217 | return err; | 219 | return err == 1 ? 0 : err; |
218 | 220 | ||
219 | while (alarmcount < 5) | 221 | while (alarmcount < 5) |
220 | sleep(1); | 222 | sleep(1); |
@@ -228,18 +230,17 @@ int do_timer_oneshot(int clock_id, int flags) | |||
228 | timer_t tm1; | 230 | timer_t tm1; |
229 | const int interval = 0; | 231 | const int interval = 0; |
230 | struct timeval timeout; | 232 | struct timeval timeout; |
231 | fd_set fds; | ||
232 | int err; | 233 | int err; |
233 | 234 | ||
234 | err = setup_timer(clock_id, flags, interval, &tm1); | 235 | err = setup_timer(clock_id, flags, interval, &tm1); |
236 | /* Unsupported case - return 0 to not fail the test */ | ||
235 | if (err) | 237 | if (err) |
236 | return err; | 238 | return err == 1 ? 0 : err; |
237 | 239 | ||
238 | memset(&timeout, 0, sizeof(timeout)); | 240 | memset(&timeout, 0, sizeof(timeout)); |
239 | timeout.tv_sec = 5; | 241 | timeout.tv_sec = 5; |
240 | FD_ZERO(&fds); | ||
241 | do { | 242 | do { |
242 | err = select(FD_SETSIZE, &fds, NULL, NULL, &timeout); | 243 | err = select(0, NULL, NULL, NULL, &timeout); |
243 | } while (err == -1 && errno == EINTR); | 244 | } while (err == -1 && errno == EINTR); |
244 | 245 | ||
245 | timer_delete(tm1); | 246 | timer_delete(tm1); |