Signed-off-by: Pierre Habouzit <madcoder@debian.org>
#include "epoll.h"
#include "threads.h"
+#define DAEMON_NAME "postlicyd"
+
/* administrivia {{{ */
static int main_initialize(void)
module_init(main_initialize);
module_exit(main_shutdown);
+void usage(void)
+{
+ fputs("usage: "DAEMON_NAME" [options] config\n"
+ "\n"
+ "Options:\n"
+ " -p <pidfile> file to write our pid to\n"
+ , stderr);
+}
+
/* }}} */
void *job_run(int fd, void *data)
pidfile = optarg;
break;
default:
- //usage();
+ usage();
return EXIT_FAILURE;
}
}
+ if (argc - optind != 1) {
+ usage();
+ return EXIT_FAILURE;
+ }
+
if (pidfile) {
f = fopen(pidfile, "w");
if (!f) {