diff options
| author | Alexander Barton <alex@barton.de> | 2011-04-12 21:23:14 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2011-04-12 21:23:14 +0200 |
| commit | e70e81460b99d6b00cb6d13d7ce7537dcd4965f8 (patch) | |
| tree | dc3767346be61dc62cc26895b48a9da8f416f547 | |
| parent | 5acb90fafc9dea012967751fb6a5c7847da1820a (diff) | |
| download | ngircd-e70e81460b99d6b00cb6d13d7ce7537dcd4965f8.tar.gz ngircd-e70e81460b99d6b00cb6d13d7ce7537dcd4965f8.zip | |
Add some type casts to random() and srandom() functions
This fixes two gcc warnings (on Mac OS X): "warning: implicit conversion shortens 64-bit value into a 32-bit value"
| -rw-r--r-- | src/ngircd/proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ngircd/proc.c b/src/ngircd/proc.c index 557543c2..217eb6d3 100644 --- a/src/ngircd/proc.c +++ b/src/ngircd/proc.c @@ -62,7 +62,7 @@ Proc_Fork(PROC_STAT *proc, int *pipefds, void (*cbfunc)(int, short), int timeout return -1; } - seed = random(); + seed = (unsigned int)random(); pid = fork(); switch (pid) { case -1: @@ -73,7 +73,7 @@ Proc_Fork(PROC_STAT *proc, int *pipefds, void (*cbfunc)(int, short), int timeout return -1; case 0: /* New child process: */ - srandom(seed ^ time(NULL) ^ getpid()); + srandom(seed ^ (unsigned int)time(NULL) ^ getpid()); Signals_Exit(); signal(SIGTERM, Proc_GenericSignalHandler); signal(SIGALRM, Proc_GenericSignalHandler); |