From patchwork Tue Dec 23 11:56:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 423669 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 530FA14009B for ; Tue, 23 Dec 2014 22:57:14 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 628A52815C2; Tue, 23 Dec 2014 12:55:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, T_DKIM_INVALID autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id EC38528021B for ; Tue, 23 Dec 2014 12:55:07 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 23 Dec 2014 12:55:07 +0100 (CET) Received: by mail-wi0-f169.google.com with SMTP id r20so12946905wiv.0 for ; Tue, 23 Dec 2014 03:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=uJXfbr26PmnIdmwNEAaUG2xeqLipO1hb8yJBfHxQfnA=; b=swutw6rNkhjWJIP03nIrBLtRlBp1KkNzxieoxvmEfl6YgXhh+qCBaB45vMh2fKNrWD bF5gvo4GQXE5DYfu0x/TytsVJQnvMkxVJkGCe7WAluzlrK5CpGXxo7qggV5mEDPaghsV fEiu7rFhEvj5VsK23XlcTCnoSoqalD6xUuPWR7TPG+Ar8zEeN84Y7peW4KklHHnMg7rF 8LQUYRxZF3NN1cJB1s2QERflzepXb3glOr7cp1/RNV5lfX+DNI4DdUjtQQf74c7pvkjl AiClNip9kfKPS3p8S1pzSF97xRQbP/PBI1sB+clv7C7Jl7L6NEcryuFc5Vz1o4a8OUSG O2lg== X-Received: by 10.194.77.201 with SMTP id u9mr45695123wjw.41.1419335823036; Tue, 23 Dec 2014 03:57:03 -0800 (PST) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id ud1sm27416826wjc.7.2014.12.23.03.57.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Dec 2014 03:57:02 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Felix Fietkau , John Crispin Date: Tue, 23 Dec 2014 12:56:52 +0100 Message-Id: <1419335812-29221-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH fstools] libfstools: fix find_mount to return device path X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" So far we were returning mount point which doesn't make sense for a function that already takes mount point as an argument. Signed-off-by: Rafał Miłecki --- libfstools/find.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libfstools/find.c b/libfstools/find.c index b50b633..4c69d73 100644 --- a/libfstools/find.c +++ b/libfstools/find.c @@ -36,6 +36,9 @@ find_overlay_mount(char *overlay) return ret; } +/* + * Find path of a device mounted to the given point. + */ char* find_mount(char *mp) { @@ -53,6 +56,7 @@ find_mount(char *mp) fclose(fp); return NULL; } + *t = '\0'; t++; s = strstr(t, " "); if (!s) { @@ -63,7 +67,7 @@ find_mount(char *mp) if (!strcmp(t, mp)) { fclose(fp); - return t; + return line; } }