Browse Source

rename to qnapd

master
Olaf Rempel 10 years ago
parent
commit
eea740593b
  1. 2
      .gitignore
  2. 4
      Makefile
  3. 16
      qnapd.c
  4. 0
      qnapd.conf

2
.gitignore

@ -1,2 +1,2 @@
build
qnaplcd
qnapd

4
Makefile

@ -7,9 +7,9 @@ PID_DIR = /var/run
# ############################
SRC = $(wildcard *.c)
TARGET = qnaplcd
TARGET = qnapd
BUILD_DIR = build
CFLAGS = -O2 -g -pipe -Wall -Wno-unused-result
CFLAGS = -O2 -g -pipe -Wall -Wno-unused-result -DPROGNAME='"$(TARGET)"'
CFLAGS += -MMD -MF $(BUILD_DIR)/$(*D)/$(*F).d
LDFLAGS =

16
qnaplcd.c → qnapd.c

@ -35,11 +35,11 @@
#include "signals.h"
#define LCD_DEVICE "/dev/ttyS0"
#define LCD_TIMEOUT 10
#define LCD_TIMEOUT 15
#define DEFAULT_CONFIG "qnaplcd.conf"
#define DEFAULT_LOGFILE "qnaplcd.log"
#define DEFAULT_PIDFILE "qnaplcd.pid"
#define DEFAULT_CONFIG PROGNAME".conf"
#define DEFAULT_LOGFILE PROGNAME".log"
#define DEFAULT_PIDFILE PROGNAME".pid"
static struct option opts[] = {
{"config", 1, 0, 'c'},
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
break;
case 'h': /* help */
printf("Usage: qnaplcd [options]\n"
printf("Usage: "PROGNAME" [options]\n"
"Options: \n"
" --config -c configfile use this configfile\n"
" --debug -d do not fork and log to stderr\n"
@ -158,7 +158,7 @@ int main(int argc, char *argv[])
/* check pidfile */
const char *pidfile = config_get_string("global", "pidfile", DEFAULT_PIDFILE);
if (pidfile_check(pidfile, 1) != 0) {
log_print(LOG_ERROR, "qnaplcd already running");
log_print(LOG_ERROR, PROGNAME" already running");
exit(1);
}
@ -183,7 +183,7 @@ int main(int argc, char *argv[])
signal_init();
signal_add_callback(SIGHUP, trigger_restart, (void *)&restart_var);
log_print(LOG_EVERYTIME, "qnaplcd started (pid:%d)", getpid());
log_print(LOG_EVERYTIME, PROGNAME" started (pid:%d)", getpid());
while (1) {
struct lcddev *dev = lcd_init(LCD_DEVICE, &button_callback, NULL);
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
if (!debug && log_init(logfile) < 0)
break;
log_print(LOG_EVERYTIME, "bcastfwd restarted (pid:%d) ", getpid());
log_print(LOG_EVERYTIME, PROGNAME" restarted (pid:%d) ", getpid());
}
return 0;

0
qnapd.conf

Loading…
Cancel
Save