summaryrefslogtreecommitdiff
path: root/tools/image-host.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/image-host.c')
-rw-r--r--tools/image-host.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/image-host.c b/tools/image-host.c
index 7cef78eab8f..e32cc642579 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -335,14 +335,14 @@ static int get_random_data(void *data, int size)
ret = clock_gettime(CLOCK_MONOTONIC, &date);
if (ret < 0) {
printf("%s: clock_gettime has failed (err=%d, str=%s)\n",
- __func__, ret, strerror(ret));
+ __func__, ret, strerror(errno));
goto out;
}
- srand(date.tv_nsec);
+ srandom(date.tv_nsec);
for (i = 0; i < size; i++) {
- *tmp = rand() & 0xff;
+ *tmp = random() & 0xff;
tmp++;
}