From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8614B139085 for ; Thu, 5 Jan 2017 00:24:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BC16CE0C0D; Thu, 5 Jan 2017 00:24:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9799FE0C0D for ; Thu, 5 Jan 2017 00:24:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B7FA8340C97 for ; Thu, 5 Jan 2017 00:24:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7F7A224EC for ; Thu, 5 Jan 2017 00:24:15 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1483575517.b73941f0c3020e3dbd1684d09685e114c678b520.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/mountinfo.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: b73941f0c3020e3dbd1684d09685e114c678b520 X-VCS-Branch: master Date: Thu, 5 Jan 2017 00:24:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c92d68fd-c4bf-4971-8a1c-f00f17e5be4a X-Archives-Hash: 5cb6d8955fcc07421544850b65870511 commit: b73941f0c3020e3dbd1684d09685e114c678b520 Author: William Hubbs gmail com> AuthorDate: Thu Jan 5 00:18:27 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Jan 5 00:18:37 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=b73941f0 mountinfo: make the path to /proc/mounts a constant This path should not be hard coded in the open call. Linux prior to 2.4.19 did not have /proc/self/mounts, so for now I'm making this value /proc/mounts everywhere, but that may change to /proc/self/mounts on linux; I'm not sure we should care about <2.4.19. X-Gentoo-Bug: 604646 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=604646 src/rc/mountinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c index 29eb160..d9c25a3 100644 --- a/src/rc/mountinfo.c +++ b/src/rc/mountinfo.c @@ -46,6 +46,7 @@ #include "_usage.h" const char *applet = NULL; +const char *procmounts = "/proc/mounts"; const char *extraopts = "[mount1] [mount2] ..."; const char *getoptstring = "f:F:n:N:o:O:p:P:iste:E:" getoptstring_COMMON; const struct option longopts[] = { @@ -323,7 +324,7 @@ find_mounts(struct args *args) int netdev; RC_STRINGLIST *list; - if ((fp = fopen("/proc/self/mounts", "r")) == NULL) + if ((fp = fopen(procmounts, "r")) == NULL) eerrorx("getmntinfo: %s", strerror(errno)); list = rc_stringlist_new();