32,8 → 32,6 |
|
/* name version number */ |
#define APP_NAME "rebootd" |
#define VERSION "1.0" |
#define REVISION "$Rev$" |
|
#define DEFAULT_PORT 19 |
#define DEFAULT_CFG_FILE "/etc/rebootd.conf" |
94,7 → 92,6 |
|
static int parse_cmd_line(struct config *cfg, int argc, const char* argv[]); |
static int parse_config_file(struct config *cfg, const char *config_name); |
static int get_revision(void); |
static void check_return(int res); |
|
static uint min(uint a, uint b) |
167,7 → 164,7 |
|
static void print_version(void) |
{ |
printf("%s %s.%d\n", APP_NAME, VERSION, get_revision()); |
printf("%s %s.%s.%s\n", APP_NAME, VER_MAJOR, VER_MINOR, VER_REVISION); |
} |
|
static void pring_usage(int argc, const char* argv[]) |
617,20 → 614,6 |
return RESULT_OK; |
} |
|
static int get_revision(void) |
{ |
int r; |
const char *begin; |
|
begin = REVISION; |
while(begin[0] != '\0' && begin[0] != ':') begin++; |
if(begin[0] == '\0') return 0; |
begin++; |
r = (int)strtol(begin, (char**)NULL, 10); |
|
return r; |
} |
|
static int save_pid(const char *pid_file, const pid_t pid) |
{ |
int fd; |