rename to qnapd

This commit is contained in:
Olaf Rempel 2011-04-25 12:20:31 +02:00
parent 20d44982da
commit eea740593b
4 changed files with 11 additions and 11 deletions

2
.gitignore vendored
View File

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

View File

@ -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 =

View File

@ -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 Normal file
View File