diff --git a/include/boost/process/v2/ext/impl/cwd.ipp b/include/boost/process/v2/ext/impl/cwd.ipp index 8f828751f..f1307e0d8 100644 --- a/include/boost/process/v2/ext/impl/cwd.ipp +++ b/include/boost/process/v2/ext/impl/cwd.ipp @@ -125,7 +125,6 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code #elif defined(__FreeBSD__) -// FIXME: Add error handling. filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec) { filesystem::path path; @@ -139,9 +138,7 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code filestat *fst = nullptr; STAILQ_FOREACH(fst, head, next) { if (fst->fs_uflags & PS_FST_UFLAG_CDIR) - { path = filesystem::canonical(fst->fs_path, ec); - } } procstat_freefiles(proc_stat, head); } @@ -160,7 +157,6 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code #elif defined(__DragonFly__) -// FIXME: Add error handling. filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec) { filesystem::path path; @@ -185,7 +181,8 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code } else BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec) - pclose(fp); + if (pclose(fp) == -1) + BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec) } else BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec)