From: Hannes Reinecke Subject: [PATCH 15/16] Compilation fix for system not providing OOM_SCORE_ADM_MIN Date: Mon, 30 Apr 2012 12:26:07 +0200 Message-ID: <1335781568-13299-17-git-send-email-hare@suse.de> References: <1335781568-13299-1-git-send-email-hare@suse.de> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1335781568-13299-1-git-send-email-hare@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Christophe Varoqui Cc: dm-devel@redhat.com, Kay Sievers List-Id: dm-devel.ids Newer systems do not provide a definition for OOM_SCORE_ADJ_MIN, so we need to test against this. Signed-off-by: Hannes Reinecke --- multipathd/main.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index 3845880..a3f82d1 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -1483,9 +1483,15 @@ setscheduler (void) static void set_oom_adj (void) { +#ifdef OOM_SCORE_ADJ_MIN int retry = 1; char *file = "/proc/self/oom_score_adj"; int score = OOM_SCORE_ADJ_MIN; +#else + int retry = 0; + char *file = "/proc/self/oom_adj"; + int score = OOM_ADJUST_MIN; +#endif FILE *fp; struct stat st; -- 1.7.3.4