valid_fd_012();
audiod_cmdline_parser_ext(argc, argv, &conf, ¶ms);
HANDLE_VERSION_FLAG("audiod", conf);
- para_drop_privileges(conf.user_arg, conf.group_arg);
+ drop_privileges_or_die(conf.user_arg, conf.group_arg);
parse_config_or_die();
if (conf.logfile_given)
logfile = open_log(conf.logfile_arg);
*
* \sa getpwnam(3), getuid(2), setuid(2), getgrnam(2), setgid(2)
*/
-void para_drop_privileges(const char *username, const char *groupname)
+void drop_privileges_or_die(const char *username, const char *groupname)
{
struct passwd *p;
char *tmp;
FILE *open_log(const char *logfile_name);
void close_log(FILE* logfile);
void log_welcome(const char *whoami, int loglevel);
-void para_drop_privileges(const char *username, const char *groupname);
+void drop_privileges_or_die(const char *username, const char *groupname);
/** used for server_uptime() */
enum uptime {UPTIME_SET, UPTIME_GET};
time_t server_uptime(enum uptime set_or_get);
/*
* setup shared memory area and get mutex for locking
*/
-static void shm_init(void)
+static void init_ipc_or_die(void)
{
void *shm;
int ret = shm_new(sizeof(struct misc_meta_data));
exit(EXIT_FAILURE);
}
-static void parse_config(int override)
+static void parse_config_or_die(int override)
{
char *home = para_homedir();
struct stat statbuf;
PARA_NOTICE_LOG("SIGHUP\n");
close_log(logfile); /* gets reopened if necessary by parse_config */
logfile = NULL;
- parse_config(1); /* reopens log */
+ parse_config_or_die(1); /* reopens log */
init_user_list(user_list_file); /* reload user list */
if (mmd->afs_pid)
kill(mmd->afs_pid, SIGHUP);
/* parse command line options */
server_cmdline_parser_ext(argc, argv, &conf, ¶ms);
HANDLE_VERSION_FLAG("server", conf);
- para_drop_privileges(conf.user_arg, conf.group_arg);
+ drop_privileges_or_die(conf.user_arg, conf.group_arg);
/* parse config file, open log and set defaults */
- parse_config(0);
+ parse_config_or_die(0);
log_welcome("para_server", conf.loglevel_arg);
- shm_init(); /* init mmd struct */
+ init_ipc_or_die(); /* init mmd struct and mmd->lock */
/* make sure, the global now pointer is uptodate */
gettimeofday(now, NULL);
server_uptime(UPTIME_SET); /* reset server uptime */