[PATCH 1/3] tgtd.c: allow oom adjust failures for non-root users

Ronnie Sahlberg <[email protected]> Tue, 7 Apr 2015 11:29:07 -0700
Newsgroups org.kernel.vger.stgt
Message-ID <[email protected]>
If run as non-root, allow failure to adjust the oom settings for
the process without aborting.

Signed-off-by: Ronnie Sahlberg <[email protected]>
---
 usr/tgtd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr/tgtd.c b/usr/tgtd.c
index 23ad413..65bc888 100644
--- a/usr/tgtd.c
+++ b/usr/tgtd.c
@@ -604,7 +604,7 @@ int main(int argc, char **argv)
 	}
 
 	err = oom_adjust();
-	if (err)
+	if (err && getuid() == 0)
 		exit(1);
 
 	err = nr_file_adjust();
-- 
2.1.0