mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-25 12:45:14 +08:00
Fix tests on FreeBSD
FreeBSD throws errors if you pass flags like O_WRONLY to mkostemp. Pass only O_CLOEXEC.
This commit is contained in:
parent
4b6639f697
commit
aafff91ac8
@ -568,7 +568,7 @@ bool env_universal_t::open_temporary_file(const wcstring &directory, wcstring *o
|
||||
int result_fd = -1;
|
||||
char *narrow_str = wcs2str(tmp_name_template.c_str());
|
||||
#if HAVE_MKOSTEMP
|
||||
result_fd = mkostemp(narrow_str, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC);
|
||||
result_fd = mkostemp(narrow_str, O_CLOEXEC);
|
||||
if (result_fd >= 0)
|
||||
{
|
||||
tmp_name = str2wcstring(narrow_str);
|
||||
|
@ -1376,7 +1376,7 @@ bool history_t::save_internal_via_rewrite()
|
||||
{
|
||||
char *narrow_str = wcs2str(tmp_name_template.c_str());
|
||||
#if HAVE_MKOSTEMP
|
||||
out_fd = mkostemp(narrow_str, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC);
|
||||
out_fd = mkostemp(narrow_str, O_CLOEXEC);
|
||||
if (out_fd >= 0)
|
||||
{
|
||||
tmp_name = str2wcstring(narrow_str);
|
||||
|
Loading…
x
Reference in New Issue
Block a user