summaryrefslogtreecommitdiff
path: root/src/timezone.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/timezone.c')
-rw-r--r--src/timezone.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/timezone.c b/src/timezone.c
index 1234622c..5b17c005 100644
--- a/src/timezone.c
+++ b/src/timezone.c
@@ -49,7 +49,7 @@ static char *read_key_file(const char *pathname, const char *key)
off_t ptrlen, keylen;
int fd;
- fd = open(pathname, O_RDONLY);
+ fd = open(pathname, O_RDONLY | O_CLOEXEC);
if (fd < 0)
return NULL;
@@ -121,7 +121,7 @@ static int compare_file(void *src_map, struct stat *src_st,
void *dst_map;
int fd, result;
- fd = open(pathname, O_RDONLY);
+ fd = open(pathname, O_RDONLY | O_CLOEXEC);
if (fd < 0)
return -1;
@@ -223,7 +223,7 @@ char *__connman_timezone_lookup(void)
DBG("sysconfig zone %s", zone);
- fd = open(ETC_LOCALTIME, O_RDONLY);
+ fd = open(ETC_LOCALTIME, O_RDONLY | O_CLOEXEC);
if (fd < 0) {
g_free(zone);
return NULL;
@@ -283,7 +283,7 @@ static int write_file(void *src_map, struct stat *src_st, const char *pathname)
unlink(pathname);
}
- fd = open(pathname, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ fd = open(pathname, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
if (fd < 0)
return -EIO;
@@ -307,7 +307,7 @@ int __connman_timezone_change(const char *zone)
snprintf(pathname, PATH_MAX, "%s/%s", USR_SHARE_ZONEINFO, zone);
- fd = open(pathname, O_RDONLY);
+ fd = open(pathname, O_RDONLY | O_CLOEXEC);
if (fd < 0)
return -EINVAL;