[Pkg-iscsi-maintainers] [open-iscsi] 17/33: PATCH 1 of 1] correctly check return value of nice()

Ritesh Raj Sarraf rrs at alioth.debian.org
Tue Nov 5 16:21:15 UTC 2013


This is an automated email from the git hooks/post-receive script.

rrs pushed a commit to branch upstream-mnc
in repository open-iscsi.

commit fdac3904c36f2d0bf0a096d533e483ec3be004d2
Author: Lee Duncan <leeman.duncan at gmail.com>
Date:   Tue May 21 14:16:38 2013 -0700

    PATCH 1 of 1] correctly check return value of nice()
    
    The nice() call can return a negative value, since
    it returns the previous nice value.
    
    Signed-off-by: Lee Duncan <leeman.duncan at gmail.com>
---
 usr/iscsi_util.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c
index 5e3420e..ac86847 100644
--- a/usr/iscsi_util.c
+++ b/usr/iscsi_util.c
@@ -60,7 +60,8 @@ int oom_adjust(void)
 	char path[ISCSI_OOM_PATH_LEN];
 	struct stat statb;
 
-	if (nice(-10) < 0)
+	errno = 0;
+	if (nice(-10) == -1 && errno != 0)
 		log_debug(1, "Could not increase process priority: %s",
 			  strerror(errno));
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-iscsi/open-iscsi.git



More information about the Pkg-iscsi-maintainers mailing list