diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-08-21 15:04:01 +1000 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-09-08 16:11:26 +0200 |
| commit | cf3a11f40210248d80194be2d5404ababeaeb17f (patch) | |
| tree | f1aa83012e3f8941737a1c2a4a819f4fc7ce6932 | |
| parent | abdc94a25679259ee88418a48145a264b37f7794 (diff) | |
| download | passt-cf3a11f40210248d80194be2d5404ababeaeb17f.tar passt-cf3a11f40210248d80194be2d5404ababeaeb17f.tar.gz passt-cf3a11f40210248d80194be2d5404ababeaeb17f.tar.bz2 passt-cf3a11f40210248d80194be2d5404ababeaeb17f.tar.lz passt-cf3a11f40210248d80194be2d5404ababeaeb17f.tar.xz passt-cf3a11f40210248d80194be2d5404ababeaeb17f.tar.zst passt-cf3a11f40210248d80194be2d5404ababeaeb17f.zip | |
util: Add missing O_CLOEXEC for !HAS_GETRANDOM path
It rarely matters, since we usually have getrandom(), but in case we don't
our open() of /dev/random was missing O_CLOEXEC, which can cause clang
warnings.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | util.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -964,7 +964,7 @@ void raw_random(void *buf, size_t buflen) { size_t random_read = 0; #ifndef HAS_GETRANDOM - int fd = open(DEV_RANDOM, O_RDONLY); + int fd = open(DEV_RANDOM, O_RDONLY | O_CLOEXEC); if (fd < 0) die_perror("Couldn't open %s", DEV_RANDOM); |
