mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 22:35:06 -05:00
switch to new util file functions
Replace all fopen(), rename(), and unlink() calls with the new util functions.
This commit is contained in:
4
util.c
4
util.c
@@ -1263,9 +1263,7 @@ UTI_GetRandomBytesUrandom(void *buf, unsigned int len)
|
||||
static FILE *f = NULL;
|
||||
|
||||
if (!f)
|
||||
f = fopen(DEV_URANDOM, "r");
|
||||
if (!f)
|
||||
LOG_FATAL("Can't open %s : %s", DEV_URANDOM, strerror(errno));
|
||||
f = UTI_OpenFile(NULL, DEV_URANDOM, NULL, 'R', 0);
|
||||
if (fread(buf, 1, len, f) != len)
|
||||
LOG_FATAL("Can't read from %s", DEV_URANDOM);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user