Cleanups and small fixes
This commit is contained in:
6
main.c
6
main.c
@@ -54,17 +54,17 @@ int main(int argc, char *argv[])
|
||||
if (task == 2 || task == 3) {
|
||||
char buf[10];
|
||||
int pid;
|
||||
FILE *fd;
|
||||
FILE *fp;
|
||||
if (task == 2)
|
||||
log_trace(VERBOSE, "We got a stop signal!");
|
||||
else if (task == 3)
|
||||
log_trace(VERBOSE, "We got a restart signal!");
|
||||
|
||||
fd = fopen(conf.rmps.pidfile, "r");
|
||||
fp = fopen(conf.rmps.pidfile, "r");
|
||||
|
||||
switch (errno) {
|
||||
case EEXIST:
|
||||
if (!fgets(buf, 10, fd)) {
|
||||
if (!fgets(buf, 10, fp)) {
|
||||
log_trace(ERROR, "Failed to read %s!", conf.rmps.pidfile);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user