From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qh5Hs-0005W3-6w for garchives@archives.gentoo.org; Wed, 13 Jul 2011 19:40:00 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 82A8321C100; Wed, 13 Jul 2011 19:39:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4A1B721C140 for ; Wed, 13 Jul 2011 19:39:52 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C25FA2AC269 for ; Wed, 13 Jul 2011 19:39:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 312598003F for ; Wed, 13 Jul 2011 19:39:51 +0000 (UTC) From: "Christian Ruppert" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Christian Ruppert" Message-ID: Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/librc/librc.c X-VCS-Directories: src/librc/ X-VCS-Committer: idl0r X-VCS-Committer-Name: Christian Ruppert X-VCS-Revision: a74382d9cb3d7f024efca46f2befb49e35c40758 Date: Wed, 13 Jul 2011 19:39:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 868a7b4829ff871067c91f56ae50967b commit: a74382d9cb3d7f024efca46f2befb49e35c40758 Author: Christian Ruppert gentoo org> AuthorDate: Wed Jul 13 19:32:13 2011 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Wed Jul 13 19:32:13 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3Da74382d9 Fix rc_service_value_get() to return multiple lines as well As introduced in bug 372547 using service_get_value() in the init scripts or using rc_service_value_get() directly will only return one line. This patch fixes it by using the new rc_getfile() function, it returns ev= en multiple lines. We're still using a char *, so the lines will be appended instead of added into new element. X-Gentoo-Bug: 372547 X-Gentoo-Bug-URL: http://bugs.gentoo.org/372547 --- src/librc/librc.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/librc/librc.c b/src/librc/librc.c index a6ff0fe..98765d8 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -767,19 +767,15 @@ librc_hidden_def(rc_service_state) char * rc_service_value_get(const char *service, const char *option) { - FILE *fp; - char *line =3D NULL; + char *buffer =3D NULL; size_t len =3D 0; char file[PATH_MAX]; =20 snprintf(file, sizeof(file), RC_SVCDIR "/options/%s/%s", service, option); - if ((fp =3D fopen(file, "r"))) { - rc_getline(&line, &len, fp); - fclose(fp); - } + rc_getfile(file, &buffer, &len); =20 - return line; + return buffer; } librc_hidden_def(rc_service_value_get) =20