Since log_open takes a booln as argument, turn use_syslog into a
bool instead of using an int. Shrinks binary size with GCC and from
C point of view, this makes the code cleaner.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/282
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
const char *filename;
char *opts = NULL;
int verbose = LOG_ERR;
- int use_syslog = 0;
+ bool use_syslog = false;
int c, r = 0;
const char *null_config = NULL;
unsigned int flags = 0;
flags |= KMOD_PROBE_FORCE_VERMAGIC;
break;
case 's':
- use_syslog = 1;
+ use_syslog = true;
break;
case 'v':
verbose++;
const char *null_config = NULL;
struct kmod_list *list, *itr;
int verbose = LOG_ERR;
- int use_syslog = 0;
+ bool use_syslog = false;
int err, c, r = 0;
while ((c = getopt_long(argc, argv, cmdopts_s, cmdopts, NULL)) != -1) {
switch (c) {
case 's':
- use_syslog = 1;
+ use_syslog = true;
break;
case 'v':
verbose++;
#include "kmod.h"
static int log_priority = LOG_CRIT;
-static int use_syslog = 0;
+static bool use_syslog = false;
#define LOG(...) log_printf(log_priority, __VA_ARGS__)
#define DEFAULT_VERBOSE LOG_WARNING
break;
case 's':
env_modprobe_options_append("-s");
- use_syslog = 1;
+ use_syslog = true;
break;
case 'q':
env_modprobe_options_append("-q");
if (!use_syslog &&
(!stderr || fileno(stderr) == -1 || fstat(fileno(stderr), &stat_buf)))
- use_syslog = 1;
+ use_syslog = true;
log_open(use_syslog);
struct kmod_ctx *ctx;
const char *null_config = NULL;
int verbose = LOG_ERR;
- int use_syslog = 0;
+ bool use_syslog = false;
int flags = 0;
int i, c, r = 0;
flags |= KMOD_REMOVE_FORCE;
break;
case 's':
- use_syslog = 1;
+ use_syslog = true;
break;
case 'v':
verbose++;