top(1): remove chdir to /

While this came out of a conversation in IRC, it turn out that some
people don't like it. Since this was a courtesy feature, just remove it.
This commit is contained in:
Eitan Adler 2018-06-03 05:07:46 +00:00
parent 1d5b01e66e
commit b7128a09ce

View File

@ -260,15 +260,6 @@ main(int argc, char *argv[])
#define CMD_order 26
#define CMD_pid 27
/*
* Since top(1) is often long running and
* doesn't typically care about where its running from
* chdir to the root to allow unmounting of its
* original wd. Failure is alright as this is
* just a courtesy for users.
*/
chdir("/");
/* set the buffer for stdout */
#ifdef DEBUG
extern FILE *debug;