mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Declare unused parameters
When building with global CFLAGS=-Wunused-parameter the output from the build looks terrible. This commit explicitly declares unused variables to prevent triggering -Wunused-parameter Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -59,6 +59,8 @@ static int call(int (*action)(svc_t *, void *), char *buf, size_t len)
|
||||
|
||||
static int stop(svc_t *svc, void *user_data)
|
||||
{
|
||||
(void)user_data;
|
||||
|
||||
if (!svc)
|
||||
return 1;
|
||||
|
||||
@@ -72,6 +74,8 @@ static int stop(svc_t *svc, void *user_data)
|
||||
|
||||
static int start(svc_t *svc, void *user_data)
|
||||
{
|
||||
(void)user_data;
|
||||
|
||||
if (!svc)
|
||||
return 1;
|
||||
|
||||
@@ -105,6 +109,8 @@ static int restart(svc_t *svc, void *user_data)
|
||||
|
||||
static int reload(svc_t *svc, void *user_data)
|
||||
{
|
||||
(void)user_data;
|
||||
|
||||
if (!svc)
|
||||
return 1;
|
||||
|
||||
@@ -149,6 +155,8 @@ static int missing(char *job, char *id, void *user_data)
|
||||
{
|
||||
char buf[20];
|
||||
|
||||
(void)user_data;
|
||||
|
||||
if (!job)
|
||||
job = "";
|
||||
if (!id)
|
||||
@@ -228,6 +236,8 @@ struct wq emergency = { .cb = bypass_shutdown };
|
||||
|
||||
static void bypass_shutdown(void *unused)
|
||||
{
|
||||
(void)unused;
|
||||
|
||||
cprintf("TIMEOUT TIMEOUT SHUTTING DOWN NOW!!\n");
|
||||
do_shutdown(halt);
|
||||
}
|
||||
@@ -332,6 +342,8 @@ static void api_cb(uev_t *w, void *arg, int events)
|
||||
int sd, lvl;
|
||||
svc_t *svc;
|
||||
|
||||
(void)arg;
|
||||
|
||||
if (UEV_ERROR == events) {
|
||||
dbg("%s(): api socket %d invalid.", __func__, w->fd);
|
||||
goto error;
|
||||
|
||||
@@ -267,6 +267,7 @@ static void cgroup_events_cb(uev_t *w, void *arg, int events)
|
||||
ssize_t sz;
|
||||
size_t off;
|
||||
|
||||
(void)arg;
|
||||
if (UEV_ERROR == events) {
|
||||
dbg("%s(): inotify socket %d invalid.", __func__, w->fd);
|
||||
return;
|
||||
|
||||
@@ -202,6 +202,9 @@ static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct
|
||||
{
|
||||
const char *cond, *ptr;
|
||||
|
||||
(void)sb;
|
||||
(void)tflag;
|
||||
|
||||
if (ftw->level == 0)
|
||||
return 1;
|
||||
|
||||
@@ -390,6 +393,8 @@ static int do_assert(const char *fpath, const struct stat *sb, int tflg, struct
|
||||
{
|
||||
char *nm;
|
||||
|
||||
(void)sb;
|
||||
|
||||
if (ftw->level == 0)
|
||||
return 1;
|
||||
|
||||
|
||||
@@ -1562,6 +1562,8 @@ static int conf_iwatch_read(int fd)
|
||||
|
||||
static void conf_cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
(void)arg;
|
||||
|
||||
if (UEV_ERROR == events) {
|
||||
dbg("%s(): iwatch socket %d invalid.", __func__, w->fd);
|
||||
return;
|
||||
|
||||
@@ -164,6 +164,8 @@ static void devmon_scandir(struct iwatch *iw, char *dir, int len)
|
||||
size_t i;
|
||||
int rc;
|
||||
|
||||
(void)iw;
|
||||
|
||||
snprintf(path, sizeof(path), "%s/*", dir);
|
||||
rc = glob(path, GLOB_NOSORT, NULL, &gl);
|
||||
if (rc && rc != GLOB_NOMATCH)
|
||||
@@ -207,6 +209,8 @@ static void devmon_cb(uev_t *w, void *arg, int events)
|
||||
ssize_t sz;
|
||||
size_t off;
|
||||
|
||||
(void)arg;
|
||||
|
||||
sz = read(w->fd, ev_buf, sizeof(ev_buf) - 1);
|
||||
if (sz <= 0) {
|
||||
err(1, "invalid inotify event");
|
||||
|
||||
@@ -293,6 +293,8 @@ static size_t print_timestamp(char *buf, size_t len)
|
||||
sscanf(buf, "%f %f", &stamp, &dummy);
|
||||
return snprintf(buf, len, "[ %.6f ]", stamp);
|
||||
#else
|
||||
(void)buf;
|
||||
(void)len;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -320,6 +320,8 @@ static int init_plugins(uev_ctx_t *ctx)
|
||||
plugin_t *p, *tmp;
|
||||
int fail = 0;
|
||||
|
||||
(void)ctx;
|
||||
|
||||
PLUGIN_ITERATOR(p, tmp) {
|
||||
if (plugin_io_init(p))
|
||||
fail++;
|
||||
|
||||
@@ -2823,6 +2823,7 @@ void service_step_all(int types)
|
||||
|
||||
void service_worker(void *unused)
|
||||
{
|
||||
(void)unused;
|
||||
service_step_all(SVC_TYPE_RESPAWN | SVC_TYPE_RUNTASK);
|
||||
}
|
||||
|
||||
|
||||
@@ -260,6 +260,7 @@ static int status_cb(int pid, void *data)
|
||||
{
|
||||
int *has_proc = (int *)data;
|
||||
|
||||
(void)pid;
|
||||
*has_proc = 1;
|
||||
|
||||
return 1;
|
||||
@@ -425,6 +426,8 @@ void do_shutdown(shutop_t op)
|
||||
*/
|
||||
static void sighup_cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
(void)arg;
|
||||
|
||||
dbg("...");
|
||||
if (UEV_ERROR == events) {
|
||||
errx(1, "Unrecoverable error in signal watcher");
|
||||
@@ -451,6 +454,9 @@ static void sighup_cb(uev_t *w, void *arg, int events)
|
||||
*/
|
||||
static void sigint_cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
(void)w;
|
||||
(void)arg;
|
||||
|
||||
dbg("...");
|
||||
if (UEV_ERROR == events) {
|
||||
errx(1, "Unrecoverable error in signal watcher");
|
||||
@@ -467,6 +473,9 @@ static void sigint_cb(uev_t *w, void *arg, int events)
|
||||
*/
|
||||
static void sigpwr_cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
(void)w;
|
||||
(void)arg;
|
||||
|
||||
dbg("...");
|
||||
if (UEV_ERROR == events) {
|
||||
errx(1, "Unrecoverable error in signal watcher");
|
||||
@@ -481,6 +490,8 @@ static void sigpwr_cb(uev_t *w, void *arg, int events)
|
||||
*/
|
||||
static void sigusr1_cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
(void)arg;
|
||||
|
||||
dbg("...");
|
||||
if (UEV_ERROR == events) {
|
||||
errx(1, "Unrecoverable error in signal watcher");
|
||||
@@ -502,6 +513,9 @@ static void sigusr1_cb(uev_t *w, void *arg, int events)
|
||||
*/
|
||||
static void sigusr2_cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
(void)w;
|
||||
(void)arg;
|
||||
|
||||
dbg("...");
|
||||
if (UEV_ERROR == events) {
|
||||
errx(1, "Unrecoverable error in signal watcher");
|
||||
@@ -522,6 +536,9 @@ static void sigusr2_cb(uev_t *w, void *arg, int events)
|
||||
*/
|
||||
static void sigterm_cb(uev_t *w, void *arg, int events)
|
||||
{
|
||||
(void)w;
|
||||
(void)arg;
|
||||
|
||||
dbg("...");
|
||||
if (UEV_ERROR == events) {
|
||||
errx(1, "Unrecoverable error in signal watcher");
|
||||
@@ -545,6 +562,9 @@ static void sigchld_cb(uev_t *w, void *arg, int events)
|
||||
int status;
|
||||
pid_t pid;
|
||||
|
||||
(void)w;
|
||||
(void)arg;
|
||||
|
||||
if (UEV_ERROR == events) {
|
||||
errx(1, "Unrecoverable error in signal watcher");
|
||||
return;
|
||||
@@ -601,6 +621,9 @@ const char *sig_name(int signo)
|
||||
*/
|
||||
static void chld_handler(int sig, siginfo_t *info, void *ctx)
|
||||
{
|
||||
(void)sig;
|
||||
(void)info;
|
||||
(void)ctx;
|
||||
/* NOP */
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,9 @@ static int parse_mm(char *arg, int *major, int *minor)
|
||||
|
||||
static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftw)
|
||||
{
|
||||
(void)sb;
|
||||
(void)tflag;
|
||||
|
||||
if (ftw->level == 0)
|
||||
return 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user