xread may return -1.

This commit is contained in:
Hisham Muhammad 2014-04-22 18:48:27 -03:00
parent 2ee1c41274
commit 28d4cad5fe
1 changed files with 1 additions and 1 deletions

View File

@ -414,7 +414,7 @@ static bool ProcessList_readStatFile(Process *process, const char* dirname, cons
int size = xread(fd, buf, MAX_READ);
close(fd);
if (!size) return false;
if (size <= 0) return false;
buf[size] = '\0';
assert(process->pid == atoi(buf));