[Pkg-running-devel] [antpm] 12/20: gant: check return value

Kristof Ralovich ralovich-guest at moszumanska.debian.org
Sun Jun 28 12:26:51 UTC 2015


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

ralovich-guest pushed a commit to branch upstream
in repository antpm.

commit b96cfcf75d0182b4b4f589d376f220d7c908f83c
Author: RALOVICH, Kristof <tade60 at freemail.hu>
Date:   Sun May 31 19:13:29 2015 +0200

    gant: check return value
---
 src/gant/gant.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gant/gant.c b/src/gant/gant.c
index 5586f99..c4e1b7c 100644
--- a/src/gant/gant.c
+++ b/src/gant/gant.c
@@ -196,11 +196,17 @@ uint randno(void)
 
   if (fd >= 0)
   {
-    read(fd, &r, sizeof r);
+    ssize_t rr = read(fd, &r, sizeof r);
     close(fd);
+    if(rr != sizeof r)
+    {
+      r = rand();
+    }
   }
   else
+  {
     r = rand();
+  }
   return r;
 }
 

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



More information about the Pkg-running-devel mailing list