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:
ridiculousfish 2014-11-01 23:57:12 -07:00
parent 4b6639f697
commit aafff91ac8
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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);