Open sockets, files etc with FD_CLOEXEC

This commit is contained in:
Daniel Eklöf 2024-10-23 09:36:59 +02:00
parent 650d1f13f9
commit a367895dc6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
12 changed files with 32 additions and 32 deletions

View file

@ -162,7 +162,7 @@ static void
find_mount_points(const char *dev_path, mount_point_list_t *mount_points)
{
int fd = open("/proc/self/mountinfo", O_RDONLY | O_CLOEXEC);
FILE *f = fd >= 0 ? fdopen(fd, "r") : NULL;
FILE *f = fd >= 0 ? fdopen(fd, "re") : NULL;
if (fd < 0 || f == NULL) {
LOG_ERRNO("failed to open /proc/self/mountinfo");