Skip to content

Commit

Permalink
Allow skipping path resolution in task::get_exe()
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-kar authored and dtrugman committed Jul 8, 2024
1 parent a4c9f1e commit b87122d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/pfs/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class task final
std::unordered_map<std::string, std::string>
get_environ(size_t max_size = 65536) const;

std::string get_exe() const;
std::string get_exe(bool resolve = true) const;

size_t count_fds() const;

Expand Down
4 changes: 2 additions & 2 deletions src/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ std::vector<cgroup> task::get_cgroups() const
return output;
}

std::string task::get_exe() const
std::string task::get_exe(bool resolve) const
{
static const std::string EXE_FILE("exe");
auto path = _task_root + EXE_FILE;

return utils::readlink(path);
return resolve ? utils::readlink(path) : path;
}

std::string task::get_cwd() const
Expand Down

0 comments on commit b87122d

Please sign in to comment.