|
|
019e51 |
This patch is a RHEL-only patch which modifies the custom changes
|
|
|
019e51 |
in the previous patches in this series to make the test case look
|
|
|
019e51 |
more like the upstream test case.
|
|
|
019e51 |
|
|
|
019e51 |
diff -rup a/stdlib/tst-system.c b/stdlib/tst-system.c
|
|
|
019e51 |
--- a/stdlib/tst-system.c 2023-07-10 13:37:53.089505036 -0400
|
|
|
019e51 |
+++ b/stdlib/tst-system.c 2023-07-10 14:04:03.922610279 -0400
|
|
|
019e51 |
@@ -173,10 +173,10 @@ do_test (void)
|
|
|
019e51 |
{
|
|
|
019e51 |
pthread_t long_sleep_thread = xpthread_create (NULL,
|
|
|
019e51 |
sleep_and_check_sigchld,
|
|
|
019e51 |
- &(double) { 2 });
|
|
|
019e51 |
+ &(double) { 0.2 });
|
|
|
019e51 |
pthread_t short_sleep_thread = xpthread_create (NULL,
|
|
|
019e51 |
sleep_and_check_sigchld,
|
|
|
019e51 |
- &(double) { 1 });
|
|
|
019e51 |
+ &(double) { 0.1 });
|
|
|
019e51 |
xpthread_join (short_sleep_thread);
|
|
|
019e51 |
xpthread_join (long_sleep_thread);
|
|
|
019e51 |
}
|
|
|
019e51 |
diff -rup a/support/shell-container.c b/support/shell-container.c
|
|
|
019e51 |
--- a/support/shell-container.c 2023-07-10 13:37:53.089505036 -0400
|
|
|
019e51 |
+++ b/support/shell-container.c 2023-07-10 14:03:20.392920627 -0400
|
|
|
019e51 |
@@ -182,15 +182,15 @@ sleep_func (char **argv)
|
|
|
019e51 |
return 1;
|
|
|
019e51 |
}
|
|
|
019e51 |
char *endptr = NULL;
|
|
|
019e51 |
- long sec = strtol (argv[0], &endptr, 0);
|
|
|
019e51 |
+ double sec = strtod (argv[0], &endptr);
|
|
|
019e51 |
if (endptr == argv[0] || errno == ERANGE || sec < 0)
|
|
|
019e51 |
{
|
|
|
019e51 |
fprintf (stderr, "sleep: invalid time interval '%s'\n", argv[0]);
|
|
|
019e51 |
return 1;
|
|
|
019e51 |
}
|
|
|
019e51 |
- if (sleep (sec) < 0)
|
|
|
019e51 |
+ if (usleep ((useconds_t)(sec * 1000000.0)) < 0)
|
|
|
019e51 |
{
|
|
|
019e51 |
- fprintf (stderr, "sleep: failed to nanosleep\n");
|
|
|
019e51 |
+ fprintf (stderr, "sleep: failed to usleep: %s\n", strerror (errno));
|
|
|
019e51 |
return 1;
|
|
|
019e51 |
}
|
|
|
019e51 |
return 0;
|