mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
tests: replace write by xwrite
Using write without cheks leads to warn unused result when __wur is enabled. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
committed by
Siddhesh Poyarekar
parent
a8c8889978
commit
026a84a54d
@@ -37,6 +37,8 @@ do_test ()
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <support/xunistd.h>
|
||||
|
||||
static pthread_barrier_t barrier;
|
||||
|
||||
/* This function is intended to rack up both user and system time. */
|
||||
@@ -55,7 +57,7 @@ chew_cpu (void *arg)
|
||||
for (int i = 0; i < 100; ++i)
|
||||
for (size_t j = 0; j < sizeof buf; ++j)
|
||||
buf[j] = 0xbb;
|
||||
write (nullfd, (char *) buf, sizeof buf);
|
||||
xwrite (nullfd, (char *) buf, sizeof buf);
|
||||
close (nullfd);
|
||||
}
|
||||
|
||||
|
@@ -11,6 +11,8 @@
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <support/xunistd.h>
|
||||
|
||||
#define TEST_CLOCK CLOCK_PROCESS_CPUTIME_ID
|
||||
#define TEST_CLOCK_MISSING(clock) \
|
||||
(setup_test () ? "process CPU clock timer support" : NULL)
|
||||
@@ -29,7 +31,7 @@ chew_cpu (void *arg)
|
||||
for (int i = 0; i < 100; ++i)
|
||||
for (size_t j = 0; j < sizeof buf; ++j)
|
||||
buf[j] = 0xbb;
|
||||
write (nullfd, (char *) buf, sizeof buf);
|
||||
xwrite (nullfd, (char *) buf, sizeof buf);
|
||||
close (nullfd);
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,8 @@
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <support/xunistd.h>
|
||||
|
||||
static clockid_t worker_thread_clock;
|
||||
|
||||
#define TEST_CLOCK worker_thread_clock
|
||||
@@ -32,7 +34,7 @@ chew_cpu (void *arg)
|
||||
for (int i = 0; i < 100; ++i)
|
||||
for (size_t j = 0; j < sizeof buf; ++j)
|
||||
buf[j] = 0xbb;
|
||||
write (nullfd, (char *) buf, sizeof buf);
|
||||
xwrite (nullfd, (char *) buf, sizeof buf);
|
||||
close (nullfd);
|
||||
}
|
||||
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#include <signal.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <support/xunistd.h>
|
||||
|
||||
static clockid_t child_clock;
|
||||
|
||||
#define TEST_CLOCK child_clock
|
||||
@@ -33,7 +35,7 @@ chew_cpu (void)
|
||||
for (int i = 0; i < 100; ++i)
|
||||
for (size_t j = 0; j < sizeof buf; ++j)
|
||||
buf[j] = 0xbb;
|
||||
write (nullfd, (char *) buf, sizeof buf);
|
||||
xwrite (nullfd, (char *) buf, sizeof buf);
|
||||
close (nullfd);
|
||||
if (getppid () == 1)
|
||||
_exit (2);
|
||||
|
Reference in New Issue
Block a user