Commit 28d4cad5 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

xread may return -1.

parent 2ee1c412
...@@ -414,7 +414,7 @@ static bool ProcessList_readStatFile(Process *process, const char* dirname, cons ...@@ -414,7 +414,7 @@ static bool ProcessList_readStatFile(Process *process, const char* dirname, cons
int size = xread(fd, buf, MAX_READ); int size = xread(fd, buf, MAX_READ);
close(fd); close(fd);
if (!size) return false; if (size <= 0) return false;
buf[size] = '\0'; buf[size] = '\0';
assert(process->pid == atoi(buf)); assert(process->pid == atoi(buf));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment