mirror of
https://github.com/troglobit/finit.git
synced 2026-10-11 17:02:42 +07:00
Remove UNUSED() macro and disable the compiler warning instead
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
AM_LDFLAGS = -module -avoid-version -shared
|
||||
AM_CFLAGS = -W -Wall -Wextra -std=gnu99
|
||||
AM_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src -U_FORTIFY_SOURCE
|
||||
AM_CPPFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
||||
AM_CPPFLAGS += $(lite_CFLAGS)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#define ALSACTL "/usr/sbin/alsactl"
|
||||
|
||||
static void save(void *UNUSED(arg))
|
||||
static void save(void *arg)
|
||||
{
|
||||
if (fexist(ALSACTL)) {
|
||||
_d("Saving sound settings ...");
|
||||
@@ -36,7 +36,7 @@ static void save(void *UNUSED(arg))
|
||||
}
|
||||
}
|
||||
|
||||
static void restore(void *UNUSED(arg))
|
||||
static void restore(void *arg)
|
||||
{
|
||||
if (fexist(ALSACTL)) {
|
||||
_d("Restoring sound settings ...");
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ static int is_tmpfs(char *path)
|
||||
return tmpfs;
|
||||
}
|
||||
|
||||
static int do_clean(const char *fpath, const struct stat *UNUSED(sb), int UNUSED(tflag), struct FTW *ftw)
|
||||
static int do_clean(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftw)
|
||||
{
|
||||
if (ftw->level == 0)
|
||||
return 1;
|
||||
@@ -96,7 +96,7 @@ static void bootclean(void)
|
||||
/*
|
||||
* Setup standard FHS 2.3 structure in /var, and write runlevel to UTMP
|
||||
*/
|
||||
static void setup(void *UNUSED(arg))
|
||||
static void setup(void *arg)
|
||||
{
|
||||
int gid;
|
||||
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ static int send_peer(int sd, char *buf, ssize_t len, struct sockaddr *sa, sockle
|
||||
return sendto(sd, pattern, strlen(pattern), MSG_DONTWAIT, sa, sa_len);
|
||||
}
|
||||
|
||||
static int cb(int UNUSED(type))
|
||||
static int cb(int type)
|
||||
{
|
||||
int sd = STDIN_FILENO;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ static int send_peer(int sd, char *buf, ssize_t len, struct sockaddr *sa, sockle
|
||||
return sendto(sd, now, strlen(now), MSG_DONTWAIT, sa, sa_len);
|
||||
}
|
||||
|
||||
static int cb(int UNUSED(type))
|
||||
static int cb(int type)
|
||||
{
|
||||
int sd = STDIN_FILENO;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
#include "helpers.h"
|
||||
#include "plugin.h"
|
||||
|
||||
static void setup(void *UNUSED(arg))
|
||||
static void setup(void *arg)
|
||||
{
|
||||
umask(0);
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
static int cb(int UNUSED(type))
|
||||
static int cb(int type)
|
||||
{
|
||||
int sd = STDIN_FILENO;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ static int recv_peer(int sd, char *buf, ssize_t len, struct sockaddr *sa, sockle
|
||||
return len;
|
||||
}
|
||||
|
||||
static int cb(int UNUSED(type))
|
||||
static int cb(int type)
|
||||
{
|
||||
int sd = STDIN_FILENO;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
+2
-2
@@ -27,14 +27,14 @@
|
||||
#include "helpers.h"
|
||||
#include "plugin.h"
|
||||
|
||||
static void save(void *UNUSED(arg))
|
||||
static void save(void *arg)
|
||||
{
|
||||
_d("Saving system clock to RTC ...");
|
||||
/* -w,--systohc, -u,--utc */
|
||||
run_interactive("/sbin/hwclock -w -u", "Saving system time (UTC) to RTC");
|
||||
}
|
||||
|
||||
static void restore(void *UNUSED(arg))
|
||||
static void restore(void *arg)
|
||||
{
|
||||
_d("Restoring system clock from RTC ...");
|
||||
/* -s,--hctosys, -u,--utc */
|
||||
|
||||
+2
-2
@@ -98,7 +98,7 @@ static void set_env(char *data)
|
||||
* For SysV compatibility the default is to halt the system when issuing
|
||||
* `init 0`, unless INIT_HALT=POWERDOWN, as performed by the SysV utils.
|
||||
*/
|
||||
static void parse(void *UNUSED(arg), int fd, int UNUSED(events))
|
||||
static void parse(void *arg, int fd, int events)
|
||||
{
|
||||
int lvl;
|
||||
struct init_request rq;
|
||||
@@ -167,7 +167,7 @@ static void parse(void *UNUSED(arg), int fd, int UNUSED(events))
|
||||
}
|
||||
|
||||
/* Must run after the base FS is up, needs /run, or /var/run */
|
||||
static void setup(void *UNUSED(arg))
|
||||
static void setup(void *arg)
|
||||
{
|
||||
_d("Setting up %s", FINIT_FIFO);
|
||||
makefifo(FINIT_FIFO, 0600);
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ static void nl_link(struct nlmsghdr *nlmsg)
|
||||
}
|
||||
}
|
||||
|
||||
static void nl_callback(void *UNUSED(arg), int sd, int UNUSED(events))
|
||||
static void nl_callback(void *arg, int sd, int events)
|
||||
{
|
||||
ssize_t len;
|
||||
static char buf[4096];
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ static char *mkcond(char *buf, size_t len, char *nm)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void pidfile_callback(void *UNUSED(arg), int fd, int UNUSED(events))
|
||||
static void pidfile_callback(void *arg, int fd, int events)
|
||||
{
|
||||
static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1];
|
||||
static char cond[MAX_ARG_LEN];
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
#include <lite/lite.h>
|
||||
#include "plugin.h"
|
||||
|
||||
static void setup(void *UNUSED(arg))
|
||||
static void setup(void *arg)
|
||||
{
|
||||
size_t i;
|
||||
glob_t gl;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* No need to clean up files in /etc/resolvconf/run/interface/
|
||||
* this is already taken care of by bootclean
|
||||
*/
|
||||
static void setup(void *UNUSED(arg))
|
||||
static void setup(void *arg)
|
||||
{
|
||||
_d("Setting up the resolver ...");
|
||||
mkpath("/etc/resolvconf", 0755);
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ static int send_peer(int sd, char *buf, ssize_t len, struct sockaddr *sa, sockle
|
||||
return sendto(sd, now, len, MSG_DONTWAIT, sa, sa_len);
|
||||
}
|
||||
|
||||
static int cb(int UNUSED(type))
|
||||
static int cb(int type)
|
||||
{
|
||||
int sd = STDIN_FILENO;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ static void setup(void)
|
||||
_pe("Failed starting TTY watcher");
|
||||
}
|
||||
|
||||
static void watcher(void *UNUSED(arg), int fd, int UNUSED(events))
|
||||
static void watcher(void *arg, int fd, int events)
|
||||
{
|
||||
int len = 0;
|
||||
char buf[EVENT_SIZE], name[42];
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@
|
||||
#include "helpers.h"
|
||||
#include "plugin.h"
|
||||
|
||||
static void setup(void *UNUSED(arg))
|
||||
static void setup(void *arg)
|
||||
{
|
||||
#ifdef RANDOMSEED
|
||||
if (!fexist(RANDOMSEED)) {
|
||||
@@ -65,7 +65,7 @@ static void setup(void *UNUSED(arg))
|
||||
#endif
|
||||
}
|
||||
|
||||
static void save(void *UNUSED(arg))
|
||||
static void save(void *arg)
|
||||
{
|
||||
#ifdef RANDOMSEED
|
||||
umask(077);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "helpers.h"
|
||||
#include "plugin.h"
|
||||
|
||||
static void setup(void *UNUSED(arg))
|
||||
static void setup(void *arg)
|
||||
{
|
||||
#ifdef PAM_CONSOLE
|
||||
int fd;
|
||||
|
||||
Reference in New Issue
Block a user