]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Don't warn root if RLIMIT_MEMLOCK is low
authorMichael S. Tsirkin <mst@dev.mellanox.co.il>
Wed, 30 May 2007 17:58:10 +0000 (10:58 -0700)
committerRoland Dreier <rolandd@cisco.com>
Wed, 30 May 2007 17:58:10 +0000 (10:58 -0700)
The amount of memory root can lock isn't limited, so the rlimit value
doesn't matter in this case.  Do not print a warning about
RLIMIT_MEMLOCK being too low if EUID is 0.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
src/init.c

index a17ae167fa5606010935745b1975b36dc0861f5b..a8bebd27a51186b2bec6406baef70df0da9c27b2 100644 (file)
@@ -412,6 +412,9 @@ static void check_memlock_limit(void)
 {
        struct rlimit rlim;
 
+       if (!geteuid())
+               return;
+
        if (getrlimit(RLIMIT_MEMLOCK, &rlim)) {
                fprintf(stderr, PFX "Warning: getrlimit(RLIMIT_MEMLOCK) failed.");
                return;