Switch file_io_t to store a wcstring

We no longer use file_io_t after fork(). We don't need to use a malloc'd
string any more. Use a wcstring.
This commit is contained in:
ridiculousfish
2019-06-09 17:43:25 -07:00
parent 0f9f00b54b
commit 6ce85aebc6
6 changed files with 27 additions and 19 deletions

View File

@@ -210,6 +210,11 @@ int open_cloexec(const std::string &cstring, int flags, mode_t mode, bool cloexe
return fd;
}
int wopen(const wcstring &pathname, int flags, mode_t mode) {
cstring tmp = wcs2string(pathname);
return open(tmp.c_str(), flags, mode);
}
int wopen_cloexec(const wcstring &pathname, int flags, mode_t mode) {
cstring tmp = wcs2string(pathname);
return open_cloexec(tmp, flags, mode, true);