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"
This commit is contained in:
Alexander Barton 2011-04-12 21:23:14 +02:00
parent 5acb90fafc
commit e70e81460b
1 changed files with 2 additions and 2 deletions

View File

@ -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);