diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-15 02:22:54 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:41 +0000 |
| commit | 1556ca717345e1424b92ff32261253ba08492b9f (patch) | |
| tree | 0f37b74d9711db08b80b499a38b7cea0151840a8 /util/nvmutil/nvmutil.c | |
| parent | 0d6bb8d7477dee92dfe593510ef646042490320f (diff) | |
nvmutil: use O_CLOEXEC on gbe files
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index fe8364f7..396fee5d 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -300,6 +300,10 @@ typedef char static_assert_off_t_is_32[(sizeof(off_t) >= 4) ? 1 : -1]; #define O_BINARY 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + #ifndef O_NOFOLLOW #define O_NOFOLLOW 0 #endif @@ -979,7 +983,8 @@ open_gbe_file(void) int flags; xopen(&gbe_fd, fname, - command[cmd_index].flags | O_BINARY | O_NOFOLLOW, &gbe_st); + command[cmd_index].flags | O_BINARY | + O_NOFOLLOW | O_CLOEXEC, &gbe_st); /* inode will be checked later on write */ gbe_dev = gbe_st.st_dev; |
