From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A238C1381F4 for ; Fri, 17 Aug 2012 18:35:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1CB34E07A1; Fri, 17 Aug 2012 18:34:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D8BD2E07A1 for ; Fri, 17 Aug 2012 18:34:56 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E76E31B4007 for ; Fri, 17 Aug 2012 18:34:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id A90B1E543A for ; Fri, 17 Aug 2012 18:34:54 +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: <1345227981.07e848638cbf0e06c0de1b01644d5d2279d696a7.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/swapfiles.in X-VCS-Directories: init.d/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 07e848638cbf0e06c0de1b01644d5d2279d696a7 X-VCS-Branch: master Date: Fri, 17 Aug 2012 18:34:54 +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: 0cc7b79a-cbcf-4d4d-a1e9-76aea01af497 X-Archives-Hash: 025a4fe3edcf94a81b8b39f5d1f199e6 commit: 07e848638cbf0e06c0de1b01644d5d2279d696a7 Author: William Hubbs gmail com> AuthorDate: Fri Aug 17 18:26:21 2012 +0000 Commit: William Hubbs gentoo org> CommitDate: Fri Aug 17 18:26:21 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=07e84863 swapfiles: make sure /proc/swaps exists If CONFIG_SWAP is turned off in the kernel, this file may not exist. In that case, we should not try to read from it. reported-by: pratyeka.org> X-Gentoo-Bug: 430378 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=430378 --- init.d/swapfiles.in | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/init.d/swapfiles.in b/init.d/swapfiles.in index f46f3c8..baf7591 100644 --- a/init.d/swapfiles.in +++ b/init.d/swapfiles.in @@ -31,14 +31,16 @@ stop() case "$RC_UNAME" in Linux) - while read filename type rest; do - case "$type" in - file) swapoff $filename >/dev/null;; - esac - case "$filename" in - /dev/loop*) swapoff $filename >/dev/null;; - esac - done < /proc/swaps + if [ -e /proc/swaps ]; then + while read filename type rest; do + case "$type" in + file) swapoff $filename >/dev/null;; + esac + case "$filename" in + /dev/loop*) swapoff $filename >/dev/null;; + esac + done < /proc/swaps + fi ;; esac eend 0