multipath: fix set_oom_adj
authorBenjamin Marzinski <bmarzins@redhat.com>
Sat, 12 Jan 2013 06:04:46 +0000 (00:04 -0600)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 12 Jan 2013 12:34:08 +0000 (13:34 +0100)
Fix set_oom_adj() to work correclty if OOM_ADJUST_MIN isn't
defined.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
multipathd/main.c

index 8917499..a6afebb 100644 (file)
@@ -1542,8 +1542,12 @@ set_oom_adj (void)
                                strerror(errno));
                        return;
                }
+#ifdef OOM_ADJUST_MIN
                file = "/proc/self/oom_adj";
                score = OOM_ADJUST_MIN;
+#else
+               retry = 0;
+#endif
        } while (retry--);
        condlog(0, "couldn't adjust oom score");
 }