Blame SOURCES/0017-PATCH-1-of-1-correctly-check-return-value-of-nice.patch

6c64be
From 8d3e9e5c3e1813b372f84d3bcca08bbe479f7f63 Mon Sep 17 00:00:00 2001
6c64be
From: Lee Duncan <leeman.duncan@gmail.com>
6c64be
Date: Tue, 21 May 2013 14:16:38 -0700
6c64be
Subject: PATCH 1 of 1] correctly check return value of nice()
6c64be
6c64be
The nice() call can return a negative value, since
6c64be
it returns the previous nice value.
6c64be
6c64be
Signed-off-by: Lee Duncan <leeman.duncan@gmail.com>
6c64be
---
6c64be
 usr/iscsi_util.c | 3 ++-
6c64be
 1 file changed, 2 insertions(+), 1 deletion(-)
6c64be
6c64be
diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c
6c64be
index 5e3420e..ac86847 100644
6c64be
--- a/usr/iscsi_util.c
6c64be
+++ b/usr/iscsi_util.c
6c64be
@@ -60,7 +60,8 @@ int oom_adjust(void)
6c64be
 	char path[ISCSI_OOM_PATH_LEN];
6c64be
 	struct stat statb;
6c64be
 
6c64be
-	if (nice(-10) < 0)
6c64be
+	errno = 0;
6c64be
+	if (nice(-10) == -1 && errno != 0)
6c64be
 		log_debug(1, "Could not increase process priority: %s",
6c64be
 			  strerror(errno));
6c64be
 
6c64be
-- 
6c64be
1.8.1.4
6c64be