@@ -85,8 +85,9 @@ bool PosixWaiter::fd_filter(int nfds, mega_fd_set_t* fds, mega_fd_set_t* ignoref
85
85
}
86
86
87
87
// wait for supplied events (sockets, filesystem changes), plus timeout + application events
88
- // maxds specifies the maximum amount of time to wait in deciseconds (or ~0 if no timeout scheduled)
89
- // returns application-specific bitmask. bit 0 set indicates that exec() needs to be called.
88
+ // maxds specifies the maximum amount of time to wait in deciseconds (or
89
+ // NEVER if no timeout scheduled) returns application-specific bitmask.
90
+ // bit 0 set indicates that exec() needs to be called.
90
91
int PosixWaiter::wait ()
91
92
{
92
93
int numfd = 0 ;
@@ -97,7 +98,7 @@ int PosixWaiter::wait()
97
98
98
99
bumpmaxfd (m_pipe[0 ]);
99
100
100
- if (maxds + 1 )
101
+ if (EVER ( maxds) )
101
102
{
102
103
dstime us = 1000000 / 10 * maxds;
103
104
@@ -108,8 +109,7 @@ int PosixWaiter::wait()
108
109
#ifdef USE_POLL
109
110
// wait infinite (-1) if maxds is max dstime OR it would overflow platform's int
110
111
int timeoutInMs = -1 ;
111
- if (maxds != std::numeric_limits<dstime>::max () &&
112
- maxds <= std::numeric_limits<int >::max () / 100 )
112
+ if (EVER (maxds) && maxds <= std::numeric_limits<int >::max () / 100 )
113
113
{
114
114
timeoutInMs = static_cast <int >(maxds) * 100 ;
115
115
}
@@ -139,7 +139,7 @@ int PosixWaiter::wait()
139
139
}
140
140
numfd = poll (fds, total, timeoutInMs);
141
141
#else
142
- numfd = select (maxfd + 1 , &rfds, &wfds, &efds, maxds + 1 ? &tv : NULL );
142
+ numfd = select (maxfd + 1 , &rfds, &wfds, &efds, EVER ( maxds) ? &tv : NULL );
143
143
#endif
144
144
145
145
// empty pipe
0 commit comments