From: Andre Noll Date: Fri, 10 Aug 2012 11:49:54 +0000 (+0200) Subject: Merge branch 't/ipc' X-Git-Tag: v0.1.5~13 X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=commitdiff_plain;h=79489a96d14274b78a654bbcf60d8eb8289cae50 Merge branch 't/ipc' 4d9f41 mutex_get(): Change parameter from key_t to int. 55c90e Implement --reload. 492928 Add the --kill subcommand. dd42f7 Use semaphore locking to avoid starting dss multiple times. 17eea8 Introduce get_config_file_name(). That topic was cooking in next for a quite some time now. --- 79489a96d14274b78a654bbcf60d8eb8289cae50 diff --cc dss.c index 968ba59,793e919..631b36d --- a/dss.c +++ b/dss.c @@@ -1219,9 -1289,21 +1257,21 @@@ static void exit_hook(int exit_code pid_t pid; DSS_NOTICE_LOG("executing %s %s\n", argv[0], argv[1]); - dss_exec(&pid, conf.exit_hook_arg, argv, fds); + dss_exec(&pid, conf.exit_hook_arg, argv); } + static void lock_dss_or_die(void) + { + char *config_file = get_config_file_name(); + int ret = lock_dss(config_file); + + free(config_file); + if (ret < 0) { + DSS_EMERG_LOG("failed to lock: %s\n", dss_strerror(-ret)); + exit(EXIT_FAILURE); + } + } + static int com_run(void) { int ret;