summaryrefslogtreecommitdiff
path: root/procps/fuser.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-06-05 01:10:03 +0000
committerDenis Vlasenko2008-06-05 01:10:03 +0000
commit49b78fc1a8f1591fa172399b3be1dba4b7f23554 (patch)
treef34271a9e766725cb6ce59c35cc98d91ddf137ac /procps/fuser.c
parenta3087ca7495e33b19b122869d17defeb9c933d19 (diff)
downloadbusybox-49b78fc1a8f1591fa172399b3be1dba4b7f23554.zip
busybox-49b78fc1a8f1591fa172399b3be1dba4b7f23554.tar.gz
Apply post-1.10.2 fixes, bump version to 1.10.31_10_3
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 fd876d5..55f7917 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;