Skip to content

Commit 995f4b8

Browse files
committed
Convert return values to bool in fpm_request.c
The return value was always one of two values.
1 parent 8e25972 commit 995f4b8

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

sapi/fpm/fpm/fpm_request.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,33 +278,35 @@ void fpm_request_check_timed_out(struct fpm_child_s *child, struct timeval *now,
278278
}
279279
/* }}} */
280280

281-
int fpm_request_is_idle(struct fpm_child_s *child) /* {{{ */
281+
bool fpm_request_is_idle(struct fpm_child_s *child) /* {{{ */
282282
{
283283
struct fpm_scoreboard_proc_s *proc;
284284

285285
/* no need in atomicity here */
286286
proc = fpm_scoreboard_proc_get_from_child(child);
287287
if (!proc) {
288-
return 0;
288+
return false;
289289
}
290290

291291
return proc->request_stage == FPM_REQUEST_ACCEPTING;
292292
}
293293
/* }}} */
294294

295-
int fpm_request_last_activity(struct fpm_child_s *child, struct timeval *tv) /* {{{ */
295+
bool fpm_request_last_activity(struct fpm_child_s *child, struct timeval *tv) /* {{{ */
296296
{
297297
struct fpm_scoreboard_proc_s *proc;
298298

299-
if (!tv) return -1;
299+
if (!tv) {
300+
return false;
301+
}
300302

301303
proc = fpm_scoreboard_proc_get_from_child(child);
302304
if (!proc) {
303-
return -1;
305+
return false;
304306
}
305307

306308
*tv = proc->tv;
307309

308-
return 1;
310+
return true;
309311
}
310312
/* }}} */

sapi/fpm/fpm/fpm_request.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ struct fpm_child_s;
2020
struct timeval;
2121

2222
void fpm_request_check_timed_out(struct fpm_child_s *child, struct timeval *tv, int terminate_timeout, int slowlog_timeout, int track_finished);
23-
int fpm_request_is_idle(struct fpm_child_s *child);
23+
bool fpm_request_is_idle(struct fpm_child_s *child);
2424
const char *fpm_request_get_stage_name(int stage);
25-
int fpm_request_last_activity(struct fpm_child_s *child, struct timeval *tv);
25+
bool fpm_request_last_activity(struct fpm_child_s *child, struct timeval *tv);
2626

2727
enum fpm_request_stage_e {
2828
FPM_REQUEST_ACCEPTING = 1,

0 commit comments

Comments
 (0)