1 |
commit: b73941f0c3020e3dbd1684d09685e114c678b520 |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Jan 5 00:18:27 2017 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 5 00:18:37 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=b73941f0 |
7 |
|
8 |
mountinfo: make the path to /proc/mounts a constant |
9 |
|
10 |
This path should not be hard coded in the open call. |
11 |
Linux prior to 2.4.19 did not have /proc/self/mounts, so for now I'm |
12 |
making this value /proc/mounts everywhere, but that may change to |
13 |
/proc/self/mounts on linux; I'm not sure we should care about <2.4.19. |
14 |
|
15 |
X-Gentoo-Bug: 604646 |
16 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=604646 |
17 |
|
18 |
src/rc/mountinfo.c | 3 ++- |
19 |
1 file changed, 2 insertions(+), 1 deletion(-) |
20 |
|
21 |
diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c |
22 |
index 29eb160..d9c25a3 100644 |
23 |
--- a/src/rc/mountinfo.c |
24 |
+++ b/src/rc/mountinfo.c |
25 |
@@ -46,6 +46,7 @@ |
26 |
#include "_usage.h" |
27 |
|
28 |
const char *applet = NULL; |
29 |
+const char *procmounts = "/proc/mounts"; |
30 |
const char *extraopts = "[mount1] [mount2] ..."; |
31 |
const char *getoptstring = "f:F:n:N:o:O:p:P:iste:E:" getoptstring_COMMON; |
32 |
const struct option longopts[] = { |
33 |
@@ -323,7 +324,7 @@ find_mounts(struct args *args) |
34 |
int netdev; |
35 |
RC_STRINGLIST *list; |
36 |
|
37 |
- if ((fp = fopen("/proc/self/mounts", "r")) == NULL) |
38 |
+ if ((fp = fopen(procmounts, "r")) == NULL) |
39 |
eerrorx("getmntinfo: %s", strerror(errno)); |
40 |
|
41 |
list = rc_stringlist_new(); |