commit - 85a575a444f08cf40de0eb553500b79b7a644a0f
commit + ca84625a7f59c0c6816cc101c975c134660946f8
blob - 87330e437e90cb316101dac1f2d8674bc6d3e01e
blob + a03ccbb5eabc4dacafbf28642cac2d1929ace78f
--- gmid.c
+++ gmid.c
int privsep_process;
int pidfd = -1;
+int debug, verbose;
+
const char *config_path = "/etc/gmid.conf";
const char *pidfile;
optarg);
break;
case 'f':
- conf.foreground = 1;
+ debug = 1;
break;
case 'h':
usage();
puts("Version: " GMID_STRING);
return 0;
case 'v':
- conf.verbose++;
+ verbose = 1;
break;
default:
usage();
procs[i].p_chroot = conf.chroot;
}
- log_init(conf.foreground, LOG_DAEMON);
- log_setverbose(conf.verbose);
+ log_init(debug, LOG_DAEMON);
+ log_setverbose(verbose);
if (title != NULL)
log_procinit(title);
/* only the parent returns */
- proc_init(ps, procs, nitems(procs), conf.foreground,
- argc0, argv, proc_id);
+ proc_init(ps, procs, nitems(procs), debug, argc0, argv, proc_id);
log_procinit("main");
- if (!conf.foreground && daemon(0, 0) == -1)
+ if (!debug && daemon(0, 0) == -1)
fatal("daemon");
pidfd = write_pidfile(pidfile);
blob - 4001c72a05e7e9d3f2942ceabe1f56826dcbf7fe
blob + de728d305468a457bbad1213dadb4272427c1157
--- gmid.h
+++ gmid.h
struct conf {
struct privsep *ps;
- int foreground;
- int verbose;
int port;
int ipv6;
uint32_t protos;