loop: clarify the pw_main_loop_run returned value

This commit is contained in:
Tristan Cacqueray 2024-06-04 08:44:12 -04:00 committed by Tristan de Cacqueray
parent 05abc4e41f
commit ce985def73
3 changed files with 10 additions and 2 deletions

View file

@ -135,5 +135,8 @@ int pw_main_loop_run(struct pw_main_loop *loop)
}
}
pw_loop_leave(loop->loop);
if (res > 0) // This is the number of fds last polled, not useful for the caller.
res = 0;
return res;
}

View file

@ -49,7 +49,10 @@ struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop);
/** Destroy a loop */
void pw_main_loop_destroy(struct pw_main_loop *loop);
/** Run a main loop. This blocks until \ref pw_main_loop_quit is called */
/** Run a main loop. This blocks until \ref pw_main_loop_quit is called.
*
* @return 0 on success, otherwise a negative number.
*/
int pw_main_loop_run(struct pw_main_loop *loop);
/** Quit a main loop */