Matches the parameter the onak binary takes and allows use of
something other than the compiled in default config file path.
* keyd.c - key retrieval daemon
*
* Jonathan McDowell <noodles@earth.li>
* keyd.c - key retrieval daemon
*
* Jonathan McDowell <noodles@earth.li>
* Copyright 2004 Project Purple
*/
#include <fcntl.h>
* Copyright 2004 Project Purple
*/
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int fd = -1;
fd_set rfds;
char sockname[1024];
int fd = -1;
fd_set rfds;
char sockname[1024];
+ char *configfile = NULL;
+ int optchar;
+ while ((optchar = getopt(argc, argv, "c:")) != -1 ) {
+ switch (optchar) {
+ case 'c':
+ configfile = strdup(optarg);
+ break;
+ }
+ }
+
+ readconfig(configfile);
+ free(configfile);
+ configfile = NULL;
initlogthing("keyd", config.logfile);
catchsignals();
initlogthing("keyd", config.logfile);
catchsignals();
cleanuplogthing();
cleanupconfig();
cleanuplogthing();
cleanupconfig();