Files
libfaketime/test/librandom.c
Daniel Kahn Gillmor f329eee8c5 Send test output to stdout, not stderr
debian autopkgtest instances (and maybe other test systems) will
report a failure if messages are sent to stderr.

Since these messages are diagnostic messages for the test suite, and
not indicators of actual failure, they should go to stdout, not
stderr.
2021-02-25 18:11:52 -05:00

18 lines
374 B
C

#include <stdio.h>
#include <sys/random.h>
void func() {
printf(" called func()\n");
}
static __attribute__((constructor)) void rnd_init() {
unsigned int targ;
ssize_t ret = getrandom(&targ, sizeof(targ), 0);
if (ret == sizeof(targ)) {
printf(" getrandom() yielded 0x%08x\n", targ);
} else {
printf(" getrandom() failed with only %zd\n", ret);
}
}