summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/filesystem-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/filesystem-unix.c')
-rw-r--r--firmware/target/hosted/filesystem-unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/target/hosted/filesystem-unix.c b/firmware/target/hosted/filesystem-unix.c
index 907d6ab14e..177cb574e0 100644
--- a/firmware/target/hosted/filesystem-unix.c
+++ b/firmware/target/hosted/filesystem-unix.c
@@ -69,7 +69,7 @@ int os_relate(const char *ospath1, const char *ospath2)
69 } 69 }
70 70
71 /* First file must stay open for duration so that its stats don't change */ 71 /* First file must stay open for duration so that its stats don't change */
72 int fd1 = os_open(ospath1, O_RDONLY); 72 int fd1 = os_open(ospath1, O_RDONLY | O_CLOEXEC);
73 if (fd1 < 0) 73 if (fd1 < 0)
74 return -2; 74 return -2;
75 75
@@ -144,7 +144,7 @@ int os_relate(const char *ospath1, const char *ospath2)
144 144
145bool os_file_exists(const char *ospath) 145bool os_file_exists(const char *ospath)
146{ 146{
147 int sim_fd = os_open(ospath, O_RDONLY, 0); 147 int sim_fd = os_open(ospath, O_RDONLY | O_CLOEXEC, 0);
148 if (sim_fd < 0) 148 if (sim_fd < 0)
149 return false; 149 return false;
150 150
@@ -157,7 +157,7 @@ bool os_file_exists(const char *ospath)
157 157
158int os_opendirfd(const char *osdirname) 158int os_opendirfd(const char *osdirname)
159{ 159{
160 return os_open(osdirname, O_RDONLY); 160 return os_open(osdirname, O_RDONLY | O_CLOEXEC);
161} 161}
162 162
163int os_opendir_and_fd(const char *osdirname, DIR **osdirpp, int *osfdp) 163int os_opendir_and_fd(const char *osdirname, DIR **osdirpp, int *osfdp)