Refine error handling used to get cwd of a pid on mac
Refine error handling used to get cwd of a pid on mac

On rare occasions, usually when using the rstudio terminal pane in
cruel and unusual ways, I'd see an error logged of the form:

21 Oct 2019 19:04:42 [rsession-gary] ERROR system error 12 (Cannot
allocate memory); LOGGED FROM: rstudio::core::FilePath
rstudio::core::system::currentWorkingDirMac(PidType)
/Users/gary/rstudio/src/cpp/core/system/PosixSystem.cpp:1230

This always seemed... unlikely, so tweaked the error handling of the
proc_pidinfo call to match the pattern used in the open-source code
for Mac lsof command. Next time this happens maybe I'll get a more
useful error code.

https://opensource.apple.com/source/lsof/lsof-62/lsof/dialects/darwin/libproc/dproc.c.auto.html

JanMarvin/rstudio,JanMarvin/rstudio,JanMarvin/rstudio,JanMarvin/rstudio,JanMarvin/rstudio,JanMarvin/rstudio,JanMarvin/rstudio,JanMarvin/rstudio,JanMarvin/rstudio