]> git.tuebingen.mpg.de Git - dss.git/commitdiff
Merge branch 't/ipc'
authorAndre Noll <maan@systemlinux.org>
Fri, 10 Aug 2012 11:49:54 +0000 (13:49 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 10 Aug 2012 11:49:54 +0000 (13:49 +0200)
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.

1  2 
dss.c
error.h

diff --cc dss.c
index 968ba597d74eb4fbcd03804f7e0cdd3fa4cab841,793e9194b1c695fb89d50d3fae5f63703dceeccd..631b36dfe12795da7ccaef38ea343b6342a14dda
--- 1/dss.c
--- 2/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;
diff --cc error.h
Simple merge