fix handle leak.
This commit is contained in:
parent
62b4e109a5
commit
feb0eee569
2
ph7.c
2
ph7.c
|
@ -34900,10 +34900,12 @@ static sxi32 SyOSUtilRandomSeed(void *pBuf,sxu32 nLen,void *pUnused)
|
|||
fd = open("/dev/urandom",O_RDONLY);
|
||||
if (fd >= 0 ){
|
||||
if( read(fd,zBuf,nLen) > 0 ){
|
||||
close(fd);
|
||||
return SXRET_OK;
|
||||
}
|
||||
/* FALL THRU */
|
||||
}
|
||||
close(fd);
|
||||
pid = getpid();
|
||||
SyMemcpy((const void *)&pid,zBuf,SXMIN(nLen,sizeof(pid_t)));
|
||||
if( &zBuf[nLen] - &zBuf[sizeof(pid_t)] >= (int)sizeof(struct timeval) ){
|
||||
|
|
Loading…
Reference in New Issue
Block a user