Check for size==1 before rounding to power of two in epoll init.
authorDan Cross <crossd@gmail.com>
Wed, 10 Aug 2016 17:43:15 +0000 (13:43 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 10 Aug 2016 19:36:04 +0000 (15:36 -0400)
commit185e3d72f1278bdda2b3ce228a33c0e4d3d87c36
treeb4aad6454ce120fb51b9120323f5c9873d3fd8d9
parent79ed782efe5b82202eb3f640e83e6c1cea2b11bd
Check for size==1 before rounding to power of two in epoll init.

While technically 1==2^0 is a power of two, the ROUNDUPPWR2
was changing the size of the epoll set to 2 before we tested
for two; since this set does not grow, we were getting errors
trying to add low-value FDs to the set, causing errors.

Slightly rearranging the order in which we do these operations
fixes this.

Change-Id: I2d068416941e8e1e9d7cfa98d56f5ea5b159802b
Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/iplib/epoll.c