repmgrd: fix parsing of -d/--daemonize option

The getopt API doesn't cope well with optional arguments to short form options,
e.g. "-o foo", so we need to check the next argument value to see whether it looks
like an option or an actual argument value.
This commit is contained in:
Ian Barwick
2018-10-04 10:47:23 +09:00
parent 3e38759c02
commit ad03885b72
2 changed files with 13 additions and 7 deletions

View File

@@ -11,6 +11,7 @@
#include "portability/instr_time.h"
#define OPT_NO_PID_FILE 1000
#define OPT_DAEMONIZE 1001
extern volatile sig_atomic_t got_SIGHUP;
extern MonitoringState monitoring_state;