Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD: fixes retrieval of the current working directory for windows/processes without subprocesses #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rhaberkorn
Copy link

  • Instead of always returning the home directory, which is what cwdOfDeepestChild() would effectively do.
  • This did not affect Linux and OpenBSD since readPath() would only require the pid. Only FreeBSD stores the cwd in struct proc_s.
  • getProcesses() also returns the complete proc_s structure now for a given pid, which includes the cwd on FreeBSD. This structure is then used for all subsequent operations.

NOTE to myself: We cannot use the same code paths on BSD and Linux since BSD's procfs does not contain cwd - unless you have mounted linprocfs of course. But it makes sense that xcwd works with the original BSD procfs as well.

…/processes without subprocesses

* Instead of always returning the home directory, which is what cwdOfDeepestChild() would
  effectively do.
* This did not affect Linux and OpenBSD since readPath() would only require the pid.
  Only FreeBSD stores the cwd in struct proc_s.
* getProcesses() also returns the complete proc_s structure now for a given pid,
  which includes the cwd on FreeBSD.
  This structure is then used for all subsequent operations.
* NOTE: We cannot use the same code paths on BSD and Linux since BSD's procfs does not
  contain cwd - unless you have mounted linprocfs of course.
  But it makes sense that xcwd works with the original BSD procfs as well.
@rhaberkorn
Copy link
Author

You should still test this on Linux to make sure I didn't break anything.

@rhaberkorn
Copy link
Author

@schischi Ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant