mirror of
https://github.com/wolfcw/libfaketime.git
synced 2026-05-17 00:26:16 +03:00
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.
18 lines
374 B
C
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);
|
|
}
|
|
}
|