Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions watchman/fs/FileDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "watchman/fs/FileDescriptor.h"
#include <folly/String.h>
#include <folly/system/Pid.h>
#include <system_error>
#include "watchman/fs/FSDetect.h"
#include "watchman/fs/FileInformation.h"
Expand Down Expand Up @@ -228,19 +227,9 @@ w_string FileDescriptor::getOpenedPath() const {
#elif defined(__linux__) || defined(__sun)
char procpath[1024];
#if defined(__linux__)
snprintf(
procpath,
sizeof(procpath),
"/proc/%d/fd/%d",
folly::get_cached_pid(),
fd_);
snprintf(procpath, sizeof(procpath), "/proc/self/fd/%d", fd_);
#elif defined(__sun)
snprintf(
procpath,
sizeof(procpath),
"/proc/%d/path/%d",
folly::get_cached_pid(),
fd_);
snprintf(procpath, sizeof(procpath), "/proc/self/path/%d", fd_);
#endif

// Avoid an extra stat by speculatively attempting to read into
Expand Down
Loading