Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'procps/fuser.c')
-rw-r--r--procps/fuser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/procps/fuser.c b/procps/fuser.c
index fd876d559..55f7917a0 100644
--- a/procps/fuser.c
+++ b/procps/fuser.c
@@ -208,6 +208,7 @@ static pid_list *scan_dir_links(const char *dname, pid_t pid,
return plist;
}
+/* NB: does chdir internally */
static pid_list *scan_proc_pids(inode_list *ilist)
{
DIR *d;
@@ -215,7 +216,8 @@ static pid_list *scan_proc_pids(inode_list *ilist)
pid_t pid;
pid_list *plist;
- d = opendir(".");
+ xchdir("/proc");
+ d = opendir("/proc");
if (!d)
return NULL;
@@ -329,7 +331,7 @@ Find processes which use FILEs or PORTs
pp++;
}
- plist = scan_proc_pids(ilist);
+ plist = scan_proc_pids(ilist); /* changes dir to "/proc" */
if (!plist)
return EXIT_FAILURE;