mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 14:10:43 +00:00
sandbox: use O_CLOEXEC in os_open()
During a cold reset execv() is used to relaunch the U-Boot binary. We must ensure that all files are closed in this case. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
35d949222f
commit
c0b19f25a1
1 changed files with 5 additions and 0 deletions
|
@ -80,6 +80,11 @@ int os_open(const char *pathname, int os_flags)
|
|||
flags |= O_CREAT;
|
||||
if (os_flags & OS_O_TRUNC)
|
||||
flags |= O_TRUNC;
|
||||
/*
|
||||
* During a cold reset execv() is used to relaunch the U-Boot binary.
|
||||
* We must ensure that all files are closed in this case.
|
||||
*/
|
||||
flags |= O_CLOEXEC;
|
||||
|
||||
return open(pathname, flags, 0777);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue