[Debian-ha-svn-commits] [SCM] corosync Debian packaging branch, master, updated. debian/1.2.1-1

Guido Günther agx at sigxcpu.org
Mon Apr 26 17:14:27 UTC 2010


The following commit has been merged in the master branch:
commit 6e03508836f14f45c0c1e68a7f80f128a4cb04a7
Author: Guido Günther <agx at sigxcpu.org>
Date:   Mon Apr 26 18:56:52 2010 +0200

    Imported Upstream version 1.2.1

diff --git a/CHANGELOG b/CHANGELOG
index 6e8697b..16ed6da 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,383 @@
 ------------------------------------------------------------------------
+r2722 | sdake | 2010-03-23 13:35:23 -0700 (Tue, 23 Mar 2010) | 6 lines
+
+Merge trunk revision 2721:
+r2721 | sdake | 2010-03-23 10:16:39 -0700 (Tue, 23 Mar 2010) | 2 lines
+
+Tone down noisy logging from ipcs system.
+
+
+------------------------------------------------------------------------
+r2720 | sdake | 2010-03-22 15:11:48 -0700 (Mon, 22 Mar 2010) | 7 lines
+
+Merge trunk revision 2719:
+r2719 | sdake | 2010-03-22 15:07:01 -0700 (Mon, 22 Mar 2010) | 3 lines
+
+Fix lockup that occurs rarely with pthread_join() is called in atexit()
+handler.
+
+
+------------------------------------------------------------------------
+r2718 | sdake | 2010-03-22 09:37:37 -0700 (Mon, 22 Mar 2010) | 8 lines
+
+Merge trunk revision 2685:
+------------------------------------------------------------------------
+r2685 | sdake | 2010-03-20 13:08:38 -0700 (Sat, 20 Mar 2010) | 3 lines
+
+Fix problem where retransmissions don't occur resulting in failure to receive
+condition.
+
+
+------------------------------------------------------------------------
+r2717 | sdake | 2010-03-22 09:36:27 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2682:
+r2682 | asalkeld | 2010-03-10 17:27:04 -0700 (Wed, 10 Mar 2010) | 2 lines
+
+Remove warnings.
+
+
+------------------------------------------------------------------------
+r2716 | sdake | 2010-03-22 09:34:23 -0700 (Mon, 22 Mar 2010) | 11 lines
+
+Merge trunk revision 2676:
+r2676 | honzaf | 2010-03-04 05:17:47 -0700 (Thu, 04 Mar 2010) | 7 lines
+
+Support for lib_cpg_finalize
+
+Add support for MESSAGE_REQ_CPG_FINALIZE message. This will allow us
+remove cpg_pd from list of active connections, and remove problem, when
+cpg_finalize + cpg_initialize + cpg_join can result in CPG_ERR_EXIST
+error.
+
+
+------------------------------------------------------------------------
+r2715 | sdake | 2010-03-22 09:33:01 -0700 (Mon, 22 Mar 2010) | 18 lines
+
+Merge trunk revision 2675:
+r2675 | honzaf | 2010-03-04 05:12:24 -0700 (Thu, 04 Mar 2010) | 14 lines
+
+Cpg join with undelivered leave message
+
+Patch handles situation, when on one node, one process:
+- join cpg
+- do same actions
+- leave cpg
+- join cpg again
+
+Following sequence can (racy) end with broken process_info list.
+
+To solve this problem, one more check is done in
+message_handler_req_lib_cpg_join so if process_info with same pid and
+group as new join request exists, CPG_ERR_TRY_AGAIN is returned.
+
+
+------------------------------------------------------------------------
+r2714 | sdake | 2010-03-22 09:32:28 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2674:
+r2674 | asalkeld | 2010-03-03 14:52:08 -0700 (Wed, 03 Mar 2010) | 2 lines
+
+Fix some "make lint" problems
+
+
+------------------------------------------------------------------------
+r2713 | sdake | 2010-03-22 09:31:33 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2673:
+r2673 | sdake | 2010-03-03 12:43:50 -0700 (Wed, 03 Mar 2010) | 2 lines
+
+Specify the ringnumber parameter must start at 0 in the corosync.conf man page.
+
+
+------------------------------------------------------------------------
+r2712 | sdake | 2010-03-22 09:31:11 -0700 (Mon, 22 Mar 2010) | 5 lines
+
+Merge trunk revision 2672:
+r2672 | sdake | 2010-03-03 12:19:12 -0700 (Wed, 03 Mar 2010) | 2 lines
+
+Fix error handling to avoid segfaults/leaks on error in coroipcc_service_connect.
+
+------------------------------------------------------------------------
+r2711 | sdake | 2010-03-22 09:30:00 -0700 (Mon, 22 Mar 2010) | 8 lines
+
+Merge trunk revision 2667:
+r2667 | chrissie | 2010-02-26 08:30:38 -0700 (Fri, 26 Feb 2010) | 5 lines
+
+Reduce the number of times the quorum message is displayed.
+
+Patch from David Teigland
+
+
+------------------------------------------------------------------------
+r2710 | sdake | 2010-03-22 09:28:48 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2666:
+r2666 | asalkeld | 2010-02-25 12:29:49 -0700 (Thu, 25 Feb 2010) | 2 lines
+
+convert giduid calls to reentrant versions.
+
+
+------------------------------------------------------------------------
+r2709 | sdake | 2010-03-22 09:27:41 -0700 (Mon, 22 Mar 2010) | 5 lines
+
+r2665 | asalkeld | 2010-02-25 12:28:36 -0700 (Thu, 25 Feb 2010) | 2 lines
+
+convert strerror() into strerror_r()
+
+
+------------------------------------------------------------------------
+r2708 | sdake | 2010-03-22 09:27:08 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2664:
+r2664 | asalkeld | 2010-02-25 12:26:54 -0700 (Thu, 25 Feb 2010) | 2 lines
+
+convert readdir into readdir_r
+
+
+------------------------------------------------------------------------
+r2707 | sdake | 2010-03-22 09:25:55 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2663:
+r2663 | asalkeld | 2010-02-25 12:25:20 -0700 (Thu, 25 Feb 2010) | 2 lines
+
+convert strtok to strtok_r
+
+
+------------------------------------------------------------------------
+r2706 | sdake | 2010-03-22 09:25:12 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2661:
+r2661 | asalkeld | 2010-02-18 13:10:36 -0700 (Thu, 18 Feb 2010) | 2 lines
+
+Correct testcpg's groupname.length
+
+
+------------------------------------------------------------------------
+r2705 | sdake | 2010-03-22 09:24:29 -0700 (Mon, 22 Mar 2010) | 7 lines
+
+Merge trunk revision 2660:
+r2660 | sdake | 2010-02-18 13:08:39 -0700 (Thu, 18 Feb 2010) | 3 lines
+
+Patch to set unset value in token hold cancel structure as to not crash
+wireshark.
+
+
+------------------------------------------------------------------------
+r2704 | sdake | 2010-03-22 09:21:32 -0700 (Mon, 22 Mar 2010) | 11 lines
+
+Merge trunk revision 2657:
+r2657 | honzaf | 2010-02-16 04:29:14 -0700 (Tue, 16 Feb 2010) | 7 lines
+
+Fix corosync shutdown process
+
+This patch change corosync shutdown process, so now:
+- exit function of service engine is called
+- all IPC connections are closed and removed from poll
+- service engine is unlocked
+
+
+------------------------------------------------------------------------
+r2703 | sdake | 2010-03-22 09:20:53 -0700 (Mon, 22 Mar 2010) | 7 lines
+
+Merge trunk revision 2656:
+r2656 | sdake | 2010-02-15 14:39:33 -0700 (Mon, 15 Feb 2010) | 3 lines
+
+Use nodeid instead of localhost ip for the case when binding to a
+loalhost interface.
+
+
+------------------------------------------------------------------------
+r2702 | sdake | 2010-03-22 09:20:30 -0700 (Mon, 22 Mar 2010) | 9 lines
+
+Merge trunk revision 2655:
+r2655 | chrissie | 2010-02-12 00:46:02 -0700 (Fri, 12 Feb 2010) | 6 lines
+
+Remove a double list_del() when a tracking CFG client shuts down without
+calling cfg_track_stop. This caused corosync to crash.
+
+The extra list_empty() check is redundant too because it also happens in remove_ci_from_shutdown()
+
+
+------------------------------------------------------------------------
+r2701 | sdake | 2010-03-22 09:19:31 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2654:
+r2654 | sdake | 2010-02-04 14:36:21 -0700 (Thu, 04 Feb 2010) | 2 lines
+
+Merge of Dejan's on=yes patch for the config parser options to ease migration.
+
+
+------------------------------------------------------------------------
+r2700 | sdake | 2010-03-22 09:19:02 -0700 (Mon, 22 Mar 2010) | 5 lines
+
+r2653 | asalkeld | 2010-02-03 17:18:51 -0700 (Wed, 03 Feb 2010) | 2 lines
+
+pass transitional members into the sync_init() callbacks.
+
+
+------------------------------------------------------------------------
+r2699 | sdake | 2010-03-22 09:18:36 -0700 (Mon, 22 Mar 2010) | 7 lines
+
+Merge trunk revision 2652:
+r2652 | asalkeld | 2010-02-03 17:13:27 -0700 (Wed, 03 Feb 2010) | 2 lines
+
+move sync_v2_init() into main_service_ready
+
+
+
+------------------------------------------------------------------------
+r2698 | sdake | 2010-03-22 09:18:06 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2651:
+r2651 | asalkeld | 2010-02-01 23:24:01 -0700 (Mon, 01 Feb 2010) | 3 lines
+
+totemsrp: fix transitional configuration changes with long token timeouts
+
+
+------------------------------------------------------------------------
+r2697 | sdake | 2010-03-22 09:17:35 -0700 (Mon, 22 Mar 2010) | 7 lines
+
+Merge trunk revision 2650:
+r2650 | sdake | 2010-01-30 16:02:40 -0700 (Sat, 30 Jan 2010) | 3 lines
+
+Fix coroipcs message corruption that occurs when a message fills the remainder
+of the dispatch buffer with a full message.
+
+
+------------------------------------------------------------------------
+r2696 | sdake | 2010-03-22 09:16:56 -0700 (Mon, 22 Mar 2010) | 10 lines
+
+Merge trunk revision 2649:
+
+r2649 | honzaf | 2010-01-22 02:45:29 -0700 (Fri, 22 Jan 2010) | 5 lines
+
+Add schedwrk_create_nolock function
+
+This patch adds schedwrk_create_nolock, which will not call
+serialize_lock before execution of callback.
+
+
+------------------------------------------------------------------------
+r2695 | sdake | 2010-03-22 09:16:12 -0700 (Mon, 22 Mar 2010) | 5 lines
+
+r2648 | honzaf | 2010-01-21 05:48:30 -0700 (Thu, 21 Jan 2010) | 2 lines
+
+Pass correct poll handle to poll_stop on exit
+
+
+------------------------------------------------------------------------
+r2694 | sdake | 2010-03-22 09:15:35 -0700 (Mon, 22 Mar 2010) | 9 lines
+
+Merge trunk revision 2647:
+r2647 | honzaf | 2010-01-21 05:46:09 -0700 (Thu, 21 Jan 2010) | 5 lines
+
+poll_dispatch_delete - ability to return 0
+
+Patch fixes poll_dispatch_delete, so it is able to return 0
+(success), when requested FD was found.
+
+
+------------------------------------------------------------------------
+r2693 | sdake | 2010-03-22 09:15:12 -0700 (Mon, 22 Mar 2010) | 10 lines
+
+Merge trunk revision 2646:
+r2646 | honzaf | 2010-01-20 06:22:38 -0700 (Wed, 20 Jan 2010) | 5 lines
+
+Fix setting invalid mode in log destination
+
+This fixes problem in revision 2642, when only last
+
+line of log destination setting is really applied.
+
+
+------------------------------------------------------------------------
+r2692 | sdake | 2010-03-22 09:14:22 -0700 (Mon, 22 Mar 2010) | 11 lines
+
+r2644 | honzaf | 2010-01-14 05:54:46 -0700 (Thu, 14 Jan 2010) | 8 lines
+
+Fix malloc deadlock in signal handler
+
+This patch solves situations, where malloc is called
+inside signal handler. It creates thread, which waits
+for semaphore unlock and then starts shutdown sequence.
+
+RHBZ#547511
+
+
+------------------------------------------------------------------------
+r2691 | sdake | 2010-03-22 09:13:48 -0700 (Mon, 22 Mar 2010) | 11 lines
+
+r2643 | honzaf | 2010-01-14 01:39:06 -0700 (Thu, 14 Jan 2010) | 8 lines
+
+Fix freeze of IPC library connection on sem_wait
+
+This patch solves library waiting on sem_wait. It doesn't
+solve all other problems, which can make corosync not
+to exit (malloc race, global lock deadlock, ...)
+
+RHBZ#547511
+
+
+------------------------------------------------------------------------
+r2690 | sdake | 2010-03-22 09:12:29 -0700 (Mon, 22 Mar 2010) | 10 lines
+
+Merge trunk revisoin 2642:
+r2642 | honzaf | 2010-01-13 02:52:07 -0700 (Wed, 13 Jan 2010) | 6 lines
+
+Fix coroparse to allow white chars before comment
+
+- allows white characters before #
+- new function to parse log destinations (remove code duplicity)
+- clarify man page
+
+
+------------------------------------------------------------------------
+r2689 | sdake | 2010-03-22 09:10:40 -0700 (Mon, 22 Mar 2010) | 10 lines
+
+Merge trunk revision 2641:
+r2641 | honzaf | 2010-01-11 03:12:17 -0700 (Mon, 11 Jan 2010) | 5 lines
+
+Generate nodeid value when unset on BSD
+
+Generated nodeid is generated in same way as
+on Linux is.
+
+
+
+------------------------------------------------------------------------
+r2688 | sdake | 2010-03-22 09:09:40 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2640:
+r2640 | sdake | 2009-12-15 12:22:36 -0700 (Tue, 15 Dec 2009) | 2 lines
+
+Remove invalid assertion in totemsrp.
+
+
+------------------------------------------------------------------------
+r2687 | sdake | 2010-03-22 09:08:57 -0700 (Mon, 22 Mar 2010) | 11 lines
+
+Merge trunk revision 2639:
+r2639 | beekhof | 2009-12-15 04:52:48 -0700 (Tue, 15 Dec 2009) | 7 lines
+
+Correctly determine current state in init script
+
+If two stop actions are ever performed simultaneously, then neither will terminate.
+With the default implementaiton of __pids_pidof, the status() function from
+/etc/init.d/functions incorrectly thinks the other stop action is a real
+corosync process.
+
+
+------------------------------------------------------------------------
+r2686 | sdake | 2010-03-22 09:08:23 -0700 (Mon, 22 Mar 2010) | 6 lines
+
+Merge trunk revision 2638:
+r2638 | asalkeld | 2009-12-08 00:48:53 -0700 (Tue, 08 Dec 2009) | 2 lines
+
+Allow empty (default) consensus timeout.
+
+
+------------------------------------------------------------------------
 r2637 | sdake | 2009-12-07 18:09:51 -0700 (Mon, 07 Dec 2009) | 6 lines
 
 Merge trunk revision 2581:
diff --git a/configure b/configure
index 4ebcf54..0e964e2 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for corosync 1.2.0.
+# Generated by GNU Autoconf 2.63 for corosync 1.2.1.
 #
 # Report bugs to <openais at lists.osdl.org>.
 #
@@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='corosync'
 PACKAGE_TARNAME='corosync'
-PACKAGE_VERSION='1.2.0'
-PACKAGE_STRING='corosync 1.2.0'
+PACKAGE_VERSION='1.2.1'
+PACKAGE_STRING='corosync 1.2.1'
 PACKAGE_BUGREPORT='openais at lists.osdl.org'
 
 ac_unique_file="lib/coroipcc.c"
@@ -1347,7 +1347,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures corosync 1.2.0 to adapt to many kinds of systems.
+\`configure' configures corosync 1.2.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1417,7 +1417,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of corosync 1.2.0:";;
+     short | recursive ) echo "Configuration of corosync 1.2.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1528,7 +1528,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-corosync configure 1.2.0
+corosync configure 1.2.1
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1542,7 +1542,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by corosync $as_me 1.2.0, which was
+It was created by corosync $as_me 1.2.1, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2391,7 +2391,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='corosync'
- VERSION='1.2.0'
+ VERSION='1.2.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2530,7 +2530,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 # Define SVN revision
 
 cat >>confdefs.h <<\_ACEOF
-#define SVN_REVISION "2637"
+#define SVN_REVISION "2723:2724"
 _ACEOF
 
 
@@ -11259,7 +11259,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by corosync $as_me 1.2.0, which was
+This file was extended by corosync $as_me 1.2.1, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -11326,7 +11326,7 @@ Report bugs to <bug-autoconf at gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-corosync config.status 1.2.0
+corosync config.status 1.2.1
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/configure.ac b/configure.ac
index 45a59d9..0a0ef04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@
 # bootstrap / init
 AC_PREREQ([2.61])
 
-AC_INIT([corosync], [1.2.0], [openais at lists.osdl.org])
+AC_INIT([corosync], [1.2.1], [openais at lists.osdl.org])
 AM_INIT_AUTOMAKE([-Wno-portability])
 
 AC_CONFIG_SRCDIR([lib/coroipcc.c])
diff --git a/exec/Makefile.am b/exec/Makefile.am
index a9aebc9..38f8d34 100644
--- a/exec/Makefile.am
+++ b/exec/Makefile.am
@@ -150,7 +150,7 @@ endif
 endif
 
 lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+	-splint $(INCLUDES) $(LINT_FLAGS) $(CFLAGS) *.c
 
 all-local: $(LCRSO_OBJS) $(LCRSO) $(SHARED_LIBS)
 	@echo Built corosync Executive
diff --git a/exec/Makefile.in b/exec/Makefile.in
index 4724d66..0538323 100644
--- a/exec/Makefile.in
+++ b/exec/Makefile.in
@@ -756,7 +756,7 @@ uninstall-am: uninstall-libLIBRARIES uninstall-local \
 @BUILD_DARWIN_FALSE@@BUILD_SOLARIS_FALSE@	ln -sf libcoroipcs.so.$(SONAME) libcoroipcs.so.$(SOMAJOR)
 
 lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+	-splint $(INCLUDES) $(LINT_FLAGS) $(CFLAGS) *.c
 
 all-local: $(LCRSO_OBJS) $(LCRSO) $(SHARED_LIBS)
 	@echo Built corosync Executive
diff --git a/exec/apidef.c b/exec/apidef.c
index 5e1f178..adb2c88 100644
--- a/exec/apidef.c
+++ b/exec/apidef.c
@@ -129,6 +129,7 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = {
 	.tpg_groups_reserve = NULL,
 	.tpg_groups_release = NULL,
 	.schedwrk_create = schedwrk_create,
+	.schedwrk_create_nolock = schedwrk_create_nolock,
 	.schedwrk_destroy = schedwrk_destroy,
 	.sync_request = NULL, //sync_request,
 	.quorum_is_quorate = corosync_quorum_is_quorate,
diff --git a/exec/coroipcs.c b/exec/coroipcs.c
index 22643ee..a64343d 100644
--- a/exec/coroipcs.c
+++ b/exec/coroipcs.c
@@ -98,6 +98,8 @@ static struct coroipcs_init_state_v2 *api = NULL;
 
 DECLARE_LIST_INIT (conn_info_list_head);
 
+DECLARE_LIST_INIT (conn_info_exit_list_head);
+
 struct outq_item {
 	void *msg;
 	size_t mlen;
@@ -464,6 +466,7 @@ static inline int conn_info_destroy (struct conn_info *conn_info)
 
 	list_del (&conn_info->list);
 	list_init (&conn_info->list);
+	list_add (&conn_info->list, &conn_info_exit_list_head);
 
 	if (conn_info->state == CONN_STATE_THREAD_REQUEST_EXIT) {
 		res = pthread_join (conn_info->thread, &retval);
@@ -982,6 +985,7 @@ static void _corosync_ipc_init(void)
 	int server_fd;
 	struct sockaddr_un un_addr;
 	int res;
+
 	/*
 	 * Create socket for IPC clients, name socket, listen for connections
 	 */
@@ -997,7 +1001,9 @@ static void _corosync_ipc_init(void)
 
 	res = fcntl (server_fd, F_SETFL, O_NONBLOCK);
 	if (res == -1) {
-		log_printf (LOGSYS_LEVEL_CRIT, "Could not set non-blocking operation on server socket: %s\n", strerror (errno));
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
+		log_printf (LOGSYS_LEVEL_CRIT, "Could not set non-blocking operation on server socket: %s\n", error_str);
 		api->fatal_error ("Could not set non-blocking operation on server socket");
 	}
 
@@ -1024,7 +1030,9 @@ static void _corosync_ipc_init(void)
 
 	res = bind (server_fd, (struct sockaddr *)&un_addr, COROSYNC_SUN_LEN(&un_addr));
 	if (res) {
-		log_printf (LOGSYS_LEVEL_CRIT, "Could not bind AF_UNIX (%s): %s.\n", un_addr.sun_path, strerror (errno));
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
+		log_printf (LOGSYS_LEVEL_CRIT, "Could not bind AF_UNIX (%s): %s.\n", un_addr.sun_path, error_str);
 		api->fatal_error ("Could not bind to AF_UNIX socket\n");
 	}
 
@@ -1054,6 +1062,11 @@ void coroipcs_ipc_exit (void)
 
 		conn_info = list_entry (list, struct conn_info, list);
 
+		if (conn_info->state != CONN_STATE_THREAD_ACTIVE)
+			continue;
+
+		ipc_disconnect (conn_info);
+
 #if _POSIX_THREAD_PROCESS_SHARED > 0
 		sem_destroy (&conn_info->control_buffer->sem0);
 		sem_destroy (&conn_info->control_buffer->sem1);
@@ -1073,9 +1086,51 @@ void coroipcs_ipc_exit (void)
 			conn_info->response_size);
 		res = circular_memory_unmap (conn_info->dispatch_buffer,
 			conn_info->dispatch_size);
+	}
+}
 
-		sem_post_exit_thread (conn_info);
+int coroipcs_ipc_service_exit (unsigned int service)
+{
+	struct list_head *list, *list_next;
+	struct conn_info *conn_info;
+
+	for (list = conn_info_list_head.next; list != &conn_info_list_head;
+		list = list_next) {
+
+		list_next = list->next;
+
+		conn_info = list_entry (list, struct conn_info, list);
+
+		if (conn_info->service != service ||
+		    (conn_info->state != CONN_STATE_THREAD_ACTIVE && conn_info->state != CONN_STATE_THREAD_REQUEST_EXIT)) {
+			continue;
+		}
+
+		ipc_disconnect (conn_info);
+		api->poll_dispatch_destroy (conn_info->fd, NULL);
+		while (conn_info_destroy (conn_info) != -1)
+			;
+
+		/*
+		 * We will return to prevent token loss. Schedwrk will call us again.
+		 */
+		return (-1);
+	}
+
+	/*
+	 * No conn info left in active list. We will traverse thru exit list. If there is any
+	 * conn_info->service == service, we will wait to proper end -> return -1
+	 */
+
+	for (list = conn_info_exit_list_head.next; list != &conn_info_exit_list_head; list = list->next) {
+		conn_info = list_entry (list, struct conn_info, list);
+
+		if (conn_info->service == service) {
+			return (-1);
+		}
 	}
+
+	return (0);
 }
 
 /*
@@ -1176,6 +1231,10 @@ static int shared_mem_dispatch_bytes_left (const struct conn_info *conn_info)
 	} else {
 		bytes_left = n_read - n_write;
 	}
+	if (bytes_left > 0) {
+		bytes_left--;
+	}
+
 	return (bytes_left);
 }
 
@@ -1203,10 +1262,10 @@ static int flow_control_event_send (struct conn_info *conn_info, char event)
 
 	if (conn_info->flow_control_state != new_fc) {
 		if (new_fc == 1) {
-			log_printf (LOGSYS_LEVEL_INFO, "Enabling flow control for %d, event %d\n",
+			log_printf (LOGSYS_LEVEL_DEBUG, "Enabling flow control for %d, event %d\n",
 				conn_info->client_pid, event);
 		} else {
-			log_printf (LOGSYS_LEVEL_INFO, "Disabling flow control for %d, event %d\n",
+			log_printf (LOGSYS_LEVEL_DEBUG, "Disabling flow control for %d, event %d\n",
 				conn_info->client_pid, event);
 		}
 		conn_info->flow_control_state = new_fc;
@@ -1467,16 +1526,20 @@ retry_accept:
 	}
 
 	if (new_fd == -1) {
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
 		log_printf (LOGSYS_LEVEL_ERROR,
-			"Could not accept Library connection: %s\n", strerror (errno));
+			"Could not accept Library connection: %s\n", error_str);
 		return (0); /* This is an error, but -1 would indicate disconnect from poll loop */
 	}
 
 	res = fcntl (new_fd, F_SETFL, O_NONBLOCK);
 	if (res == -1) {
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
 		log_printf (LOGSYS_LEVEL_ERROR,
 			"Could not set non-blocking operation on library connection: %s\n",
-			strerror (errno));
+			error_str);
 		close (new_fd);
 		return (0); /* This is an error, but -1 would indicate disconnect from poll loop */
 	}
diff --git a/exec/coroparse.c b/exec/coroparse.c
index ba7e954..a1e3843 100644
--- a/exec/coroparse.c
+++ b/exec/coroparse.c
@@ -49,6 +49,7 @@
 #include <string.h>
 #include <dirent.h>
 #include <limits.h>
+#include <stddef.h>
 
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/objdb.h>
@@ -115,6 +116,7 @@ static int parse_section(FILE *fp,
 	char line[512];
 	int i;
 	char *loc;
+	int ignore_line;
 
 	while (fgets (line, sizeof (line), fp)) {
 		if (strlen(line) > 0) {
@@ -133,10 +135,20 @@ static int parse_section(FILE *fp,
 				break;
 			}
 		}
+
+		ignore_line = 1;
+		for (i = 0; i < strlen (line); i++) {
+			if (line[i] != '\t' && line[i] != ' ') {
+				if (line[i] != '#')
+					ignore_line = 0;
+
+				break;
+			}
+		}
 		/*
 		 * Clear out comments and empty lines
 		 */
-		if (line[0] == '#' || line[0] == '\0') {
+		if (ignore_line) {
 			continue;
 		}
 
@@ -253,8 +265,11 @@ static int read_uidgid_files_into_objdb(
 	const char *dirname;
 	DIR *dp;
 	struct dirent *dirent;
+	struct dirent *entry;
 	char filename[PATH_MAX + FILENAME_MAX + 1];
 	int res = 0;
+	size_t len;
+	int return_code;
 	struct stat stat_buf;
 
 	dirname = COROSYSCONFDIR "/uidgid.d";
@@ -263,7 +278,14 @@ static int read_uidgid_files_into_objdb(
 	if (dp == NULL)
 		return 0;
 
-	while ((dirent = readdir (dp))) {
+	len = offsetof(struct dirent, d_name) +
+                     pathconf(dirname, _PC_NAME_MAX) + 1;
+	entry = malloc(len);
+
+	for (return_code = readdir_r(dp, entry, &dirent);
+		dirent != NULL && return_code == 0;
+		return_code = readdir_r(dp, entry, &dirent)) {
+
 		snprintf(filename, sizeof (filename), "%s/%s", dirname, dirent->d_name);
 		stat (filename, &stat_buf);
 		if (S_ISREG(stat_buf.st_mode)) {
@@ -282,6 +304,7 @@ static int read_uidgid_files_into_objdb(
 	}
 
 error_exit:
+	free (entry);
 	closedir(dp);
 
 	return res;
@@ -295,9 +318,12 @@ static int read_service_files_into_objdb(
 	const char *dirname;
 	DIR *dp;
 	struct dirent *dirent;
+	struct dirent *entry;
 	char filename[PATH_MAX + FILENAME_MAX + 1];
 	int res = 0;
 	struct stat stat_buf;
+	size_t len;
+	int return_code;
 
 	dirname = COROSYSCONFDIR "/service.d";
 	dp = opendir (dirname);
@@ -305,7 +331,14 @@ static int read_service_files_into_objdb(
 	if (dp == NULL)
 		return 0;
 
-	while ((dirent = readdir (dp))) {
+	len = offsetof(struct dirent, d_name) +
+                     pathconf(dirname, _PC_NAME_MAX) + 1;
+	entry = malloc(len);
+
+	for (return_code = readdir_r(dp, entry, &dirent);
+		dirent != NULL && return_code == 0;
+		return_code = readdir_r(dp, entry, &dirent)) {
+
 		snprintf(filename, sizeof (filename), "%s/%s", dirname, dirent->d_name);
 		stat (filename, &stat_buf);
 		if (S_ISREG(stat_buf.st_mode)) {
@@ -324,6 +357,7 @@ static int read_service_files_into_objdb(
 	}
 
 error_exit:
+	free (entry);
 	closedir(dp);
 
 	return res;
@@ -345,9 +379,11 @@ static int read_config_file_into_objdb(
 
 	fp = fopen (filename, "r");
 	if (fp == NULL) {
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
 		snprintf (error_reason, sizeof(error_string_response),
 			"Can't read file %s reason = (%s)\n",
-			 filename, strerror (errno));
+			 filename, error_str);
 		*error_string = error_reason;
 		return -1;
 	}
diff --git a/exec/coropoll.c b/exec/coropoll.c
index 3c8df8d..8f18f0f 100644
--- a/exec/coropoll.c
+++ b/exec/coropoll.c
@@ -260,6 +260,8 @@ int poll_dispatch_delete (
 			poll_instance->ufds[i].fd = -1;
 			poll_instance->poll_entries[i].ufd.fd = -1;
 			poll_instance->poll_entries[i].ufd.revents = 0;
+
+			res = 0;
 			break;
 		}
 	}
diff --git a/exec/evil.c b/exec/evil.c
index 6d25f9a..9d61c5b 100644
--- a/exec/evil.c
+++ b/exec/evil.c
@@ -117,16 +117,18 @@ static void deliver_fn_evt_compat (
 	unsigned int endian_conversion_required);
 
 static struct sync_callbacks clm_sync_operations = {
+	.api_version		= 1,
 	.name			= "dummy CLM service",
-	.sync_init		= clm_sync_init,
+	.sync_init_api.sync_init_v1 = clm_sync_init,
 	.sync_process		= clm_sync_process,
 	.sync_activate		= clm_sync_activate,
 	.sync_abort		= clm_sync_abort,
 };
 
 static struct sync_callbacks evt_sync_operations = {
+	.api_version		= 1,
 	.name			= "dummy EVT service",
-	.sync_init		= evt_sync_init,
+	.sync_init_api.sync_init_v1 = evt_sync_init,
 	.sync_process		= evt_sync_process,
 	.sync_activate		= evt_sync_activate,
 	.sync_abort		= evt_sync_abort,
@@ -212,7 +214,7 @@ extern int evil_callbacks_load (int sync_id,
 
 	}
 	if (callbacks_init) {
-		callbacks->sync_init = sync_dummy_init;
+		callbacks->sync_init_api.sync_init_v1 = sync_dummy_init;
 		callbacks->sync_process = sync_dummy_process;
 		callbacks->sync_activate = sync_dummy_activate;
 		callbacks->sync_abort = sync_dummy_abort;
diff --git a/exec/logsys.c b/exec/logsys.c
index d43f983..c214350 100644
--- a/exec/logsys.c
+++ b/exec/logsys.c
@@ -943,12 +943,14 @@ static int logsys_config_file_set_unlocked (
 
 	logsys_loggers[subsysid].logfile_fp = fopen (file, "a+");
 	if (logsys_loggers[subsysid].logfile_fp == NULL) {
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
 		free(logsys_loggers[subsysid].logfile);
 		logsys_loggers[subsysid].logfile = NULL;
 		snprintf (error_string_response,
 			sizeof(error_string_response),
 			"Can't open logfile '%s' for reason (%s).\n",
-				 file, strerror (errno));
+				 file, error_str);
 		*error_string = error_string_response;
 		return (-1);
 	}
@@ -1074,7 +1076,6 @@ int _logsys_wthread_create (void)
 	if (((logsys_loggers[LOGSYS_MAX_SUBSYS_COUNT].mode & LOGSYS_MODE_FORK) == 0) &&
 		((logsys_loggers[LOGSYS_MAX_SUBSYS_COUNT].mode & LOGSYS_MODE_THREADED) != 0)) {
 		wthread_create();
-		atexit (logsys_atexit);
 	}
 	return (0);
 }
diff --git a/exec/main.c b/exec/main.c
index 2a2fded..3dac3de 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -56,6 +56,7 @@
 #include <signal.h>
 #include <sched.h>
 #include <time.h>
+#include <semaphore.h>
 
 #include <corosync/swab.h>
 #include <corosync/corotypes.h>
@@ -121,8 +122,6 @@ static struct corosync_api_v1 *api = NULL;
 
 static enum cs_sync_mode minimum_sync_mode;
 
-static enum cs_sync_mode minimum_sync_mode;
-
 static int sync_in_process = 1;
 
 static hdb_handle_t corosync_poll_handle;
@@ -133,6 +132,10 @@ static hdb_handle_t object_connection_handle;
 
 static corosync_timer_handle_t corosync_stats_timer_handle;
 
+static pthread_t corosync_exit_thread;
+
+static sem_t corosync_exit_sem;
+
 hdb_handle_t corosync_poll_handle_get (void)
 {
 	return (corosync_poll_handle);
@@ -151,9 +154,8 @@ void corosync_state_dump (void)
 
 static void unlink_all_completed (void)
 {
-	poll_stop (0);
+	poll_stop (corosync_poll_handle);
 	totempg_finalize ();
-	coroipcs_ipc_exit ();
 
 	corosync_exit_error (AIS_DONE_EXIT);
 }
@@ -167,7 +169,17 @@ void corosync_shutdown_request (void)
 	if (called == 0) {
 		called = 1;
 	}
+
+	sem_post (&corosync_exit_sem);
+}
+
+static void *corosync_exit_thread_handler (void *arg)
+{
+	sem_wait (&corosync_exit_sem);
+
 	corosync_service_unlink_all (api, unlink_all_completed);
+
+	return arg;
 }
 
 static void sigusr2_handler (int num)
@@ -261,7 +273,8 @@ static int corosync_sync_callbacks_retrieve (int sync_id,
 		ais_service_index++) {
 
 		if (ais_service[ais_service_index] != NULL
-			&& ais_service[ais_service_index]->sync_mode == CS_SYNC_V1) {
+			&& (ais_service[ais_service_index]->sync_mode == CS_SYNC_V1
+				|| ais_service[ais_service_index]->sync_mode == CS_SYNC_V1_APIV2)) {
 			if (ais_service_index == sync_id) {
 				break;
 			}
@@ -275,7 +288,11 @@ static int corosync_sync_callbacks_retrieve (int sync_id,
 		return (res);
 	}
 	callbacks->name = ais_service[ais_service_index]->name;
-	callbacks->sync_init = ais_service[ais_service_index]->sync_init;
+	callbacks->sync_init_api.sync_init_v1 = ais_service[ais_service_index]->sync_init;
+	callbacks->api_version = 1;
+	if (ais_service[ais_service_index]->sync_mode == CS_SYNC_V1_APIV2) {
+		callbacks->api_version = 2;
+	}
 	callbacks->sync_process = ais_service[ais_service_index]->sync_process;
 	callbacks->sync_activate = ais_service[ais_service_index]->sync_activate;
 	callbacks->sync_abort = ais_service[ais_service_index]->sync_abort;
@@ -304,7 +321,13 @@ static int corosync_sync_v2_callbacks_retrieve (
 	}
 
 	callbacks->name = ais_service[service_id]->name;
-	callbacks->sync_init = ais_service[service_id]->sync_init;
+
+	callbacks->api_version = 1;
+	if (ais_service[service_id]->sync_mode == CS_SYNC_V1_APIV2) {
+		callbacks->api_version = 2;
+	}
+
+	callbacks->sync_init_api.sync_init_v1 = ais_service[service_id]->sync_init;
 	callbacks->sync_process = ais_service[service_id]->sync_process;
 	callbacks->sync_activate = ais_service[service_id]->sync_activate;
 	callbacks->sync_abort = ais_service[service_id]->sync_abort;
@@ -346,6 +369,9 @@ static void confchg_fn (
 	if (abort_activate) {
 		sync_v2_abort ();
 	}
+	if (minimum_sync_mode == CS_SYNC_V2 && configuration_type == TOTEM_CONFIGURATION_TRANSITIONAL) {
+		sync_v2_save_transitional (member_list, member_list_entries, ring_id);
+	}
 	if (minimum_sync_mode == CS_SYNC_V2 && configuration_type == TOTEM_CONFIGURATION_REGULAR) {
 		sync_v2_start (member_list, member_list_entries, ring_id);
 	}
@@ -425,7 +451,11 @@ static void corosync_mlockall (void)
 #else
 	res = mlockall (MCL_CURRENT | MCL_FUTURE);
 	if (res == -1) {
-		log_printf (LOGSYS_LEVEL_WARNING, "Could not lock memory of service to avoid page faults: %s\n", strerror (errno));
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
+		log_printf (LOGSYS_LEVEL_WARNING,
+			"Could not lock memory of service to avoid page faults: %s\n",
+			error_str);
 	};
 #endif
 }
@@ -828,7 +858,7 @@ static int corosync_security_valid (int euid, int egid)
 
 static int corosync_service_available (unsigned int service)
 {
-	return (ais_service[service] != NULL);
+	return (ais_service[service] != NULL && !ais_service_exiting[service]);
 }
 
 struct sending_allowed_private_data_struct {
@@ -934,6 +964,12 @@ static void corosync_poll_dispatch_modify (
 		corosync_poll_handler_dispatch);
 }
 
+static void corosync_poll_dispatch_destroy (
+    int fd,
+    void *context)
+{
+	poll_dispatch_delete (corosync_poll_handle, fd);
+}
 
 static hdb_handle_t corosync_stats_create_connection (const char* name,
                        const pid_t pid, const int fd)
@@ -1071,6 +1107,7 @@ static struct coroipcs_init_state_v2 ipc_init_state_v2 = {
 	.poll_accept_add		= corosync_poll_accept_add,
 	.poll_dispatch_add		= corosync_poll_dispatch_add,
 	.poll_dispatch_modify		= corosync_poll_dispatch_modify,
+	.poll_dispatch_destroy		= corosync_poll_dispatch_destroy,
 	.init_fn_get			= corosync_init_fn_get,
 	.exit_fn_get			= corosync_exit_fn_get,
 	.handler_fn_get			= corosync_handler_fn_get,
@@ -1091,9 +1128,11 @@ static void corosync_setscheduler (void)
 		global_sched_param.sched_priority = sched_priority;
 		res = sched_setscheduler (0, SCHED_RR, &global_sched_param);
 		if (res == -1) {
+			char error_str[100];
+			strerror_r (errno, error_str, 100);
 			global_sched_param.sched_priority = 0;
 			log_printf (LOGSYS_LEVEL_WARNING, "Could not set SCHED_RR at priority %d: %s\n",
-				global_sched_param.sched_priority, strerror (errno));
+				global_sched_param.sched_priority, error_str);
 
 			logsys_thread_priority_set (SCHED_OTHER, NULL, 1);
 		} else {
@@ -1114,7 +1153,11 @@ static void corosync_setscheduler (void)
 			}
 		}
 	} else {
-		log_printf (LOGSYS_LEVEL_WARNING, "Could not get maximum scheduler priority: %s\n", strerror (errno));
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
+		log_printf (LOGSYS_LEVEL_WARNING,
+			"Could not get maximum scheduler priority: %s\n",
+			error_str);
 		sched_priority = 0;
 	}
 #else
@@ -1166,6 +1209,26 @@ static void main_service_ready (void)
 	evil_init (api);
 	corosync_stats_init ();
 	corosync_totem_stats_init ();
+	if (minimum_sync_mode == CS_SYNC_V2) {
+		log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to none.  Using V2 of the synchronization engine.\n");
+		sync_v2_init (
+			corosync_sync_v2_callbacks_retrieve,
+			corosync_sync_completed);
+	} else
+	if (minimum_sync_mode == CS_SYNC_V1) {
+		log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to whitetank.  Using V1 and V2 of the synchronization engine.\n");
+		sync_register (
+			corosync_sync_callbacks_retrieve,
+			sync_v2_memb_list_determine,
+			sync_v2_memb_list_abort,
+			sync_v2_start);
+
+		sync_v2_init (
+			corosync_sync_v2_callbacks_retrieve,
+			corosync_sync_completed);
+	}
+
+
 }
 
 int main (int argc, char **argv)
@@ -1181,6 +1244,7 @@ int main (int argc, char **argv)
 	const char *config_iface_init;
 	char *config_iface;
 	char *iface;
+	char *strtok_save_pt;
 	int res, ch;
 	int background, setprio;
 	struct stat stat_out;
@@ -1288,7 +1352,7 @@ int main (int argc, char **argv)
 		corosync_exit_error (AIS_DONE_OBJDB);
 	}
 
-	iface = strtok(config_iface, ":");
+	iface = strtok_r(config_iface, ":", &strtok_save_pt);
 	while (iface)
 	{
 		res = lcr_ifact_reference (
@@ -1312,7 +1376,7 @@ int main (int argc, char **argv)
 		log_printf (LOGSYS_LEVEL_NOTICE, "%s", error_string);
 		config_modules[num_config_modules++] = config;
 
-		iface = strtok(NULL, ":");
+		iface = strtok_r(NULL, ":", &strtok_save_pt);
 	}
 	free(config_iface);
 
@@ -1421,6 +1485,21 @@ int main (int argc, char **argv)
 // TODO what is this hack for?	usleep(totem_config.token_timeout * 2000);
 
 	/*
+	 * Create semaphore and start "exit" thread
+	 */
+	res = sem_init (&corosync_exit_sem, 0, 0);
+	if (res != 0) {
+		log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't create exit thread.\n");
+		corosync_exit_error (AIS_DONE_FATAL_ERR);
+	}
+
+	res = pthread_create (&corosync_exit_thread, NULL, corosync_exit_thread_handler, NULL);
+	if (res != 0) {
+		log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't create exit thread.\n");
+		corosync_exit_error (AIS_DONE_FATAL_ERR);
+	}
+
+	/*
 	 * if totempg_initialize doesn't have root priveleges, it cannot
 	 * bind to a specific interface.  This only matters if
 	 * there is more then one interface in a system, so
@@ -1447,26 +1526,6 @@ int main (int argc, char **argv)
 		&corosync_group,
 		1);
 
-	if (minimum_sync_mode == CS_SYNC_V2) {
-		log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to none.  Using V2 of the synchronization engine.\n");
-		sync_v2_init (
-			corosync_sync_v2_callbacks_retrieve,
-			corosync_sync_completed);
-	} else
-	if (minimum_sync_mode == CS_SYNC_V1) {
-		log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to whitetank.  Using V1 and V2 of the synchronization engine.\n");
-		sync_register (
-			corosync_sync_callbacks_retrieve,
-			sync_v2_memb_list_determine,
-			sync_v2_memb_list_abort,
-			sync_v2_start);
-
-		sync_v2_init (
-			corosync_sync_v2_callbacks_retrieve,
-			corosync_sync_completed);
-	}
-
-
 	/*
 	 * Drop root privleges to user 'ais'
 	 * TODO: Don't really need full root capabilities;
diff --git a/exec/mainconfig.c b/exec/mainconfig.c
index 5cc864d..b343b81 100644
--- a/exec/mainconfig.c
+++ b/exec/mainconfig.c
@@ -255,6 +255,55 @@ parse_error:
 	return (-1);
 }
 
+static int corosync_main_config_log_destination_set (
+	struct objdb_iface_ver0 *objdb,
+	hdb_handle_t object_handle,
+	const char *subsys,
+	const char **error_string,
+	const char *objdb_key,
+	unsigned int mode_mask,
+	char deprecated,
+	const char *replacement)
+{
+	static char formatted_error_reason[128];
+	char *value;
+	unsigned int mode;
+
+	if (!objdb_get_string (objdb, object_handle, objdb_key, &value)) {
+		if (deprecated) {
+			log_printf(LOGSYS_LEVEL_WARNING,
+			 "Warning: the %s config paramater has been obsoleted."
+			 " See corosync.conf man page %s directive.",
+			 objdb_key, replacement);
+		}
+
+		mode = logsys_config_mode_get (subsys);
+
+		if (strcmp (value, "yes") == 0 || strcmp (value, "on") == 0) {
+			mode |= mode_mask;
+			if (logsys_config_mode_set(subsys, mode) < 0) {
+				sprintf (formatted_error_reason, "unable to set mode %s", objdb_key);
+				*error_string = formatted_error_reason;
+				return -1;
+			}
+		} else
+		if (strcmp (value, "no") == 0 || strcmp (value, "off") == 0) {
+			mode &= ~mode_mask;
+			if (logsys_config_mode_set(subsys, mode) < 0) {
+				sprintf (formatted_error_reason, "unable to unset mode %s", objdb_key);
+				*error_string = formatted_error_reason;
+				return -1;
+			}
+		} else {
+			sprintf (formatted_error_reason, "unknown value for %s", objdb_key);
+			*error_string = formatted_error_reason;
+			return -1;
+		}
+	}
+
+	return 0;
+}
+
 static int corosync_main_config_set (
 	struct objdb_iface_ver0 *objdb,
 	hdb_handle_t object_handle,
@@ -287,90 +336,21 @@ static int corosync_main_config_set (
 		goto parse_error;
 	}
 
-	if (!objdb_get_string (objdb,object_handle, "to_file", &value)) {
-
-		log_printf(LOGSYS_LEVEL_WARNING,
-		 "Warning: the to_file config paramater has been obsoleted."
-		 " See corosync.conf man page to_logfile directive.");
-
-		if (strcmp (value, "yes") == 0) {
-			mode |= LOGSYS_MODE_OUTPUT_FILE;
-			if (logsys_config_mode_set(subsys, mode) < 0) {
-				error_reason = "unable to set mode to_file";
-				goto parse_error;
-			}
-		} else
-		if (strcmp (value, "no") == 0) {
-			mode &= ~LOGSYS_MODE_OUTPUT_FILE;
-			if (logsys_config_mode_set(subsys, mode) < 0) {
-				error_reason = "unable to unset mode to_file";
-				goto parse_error;
-			}
-		} else {
-			error_reason = "unknown value for to_file";
-			goto parse_error;
-		}
-	}
+	if (corosync_main_config_log_destination_set (objdb, object_handle, subsys, &error_reason,
+	    "to_logfile", LOGSYS_MODE_OUTPUT_FILE, 0, NULL) != 0)
+		goto parse_error;
 
-	if (!objdb_get_string (objdb,object_handle, "to_logfile", &value)) {
-		if (strcmp (value, "yes") == 0) {
-			mode |= LOGSYS_MODE_OUTPUT_FILE;
-			if (logsys_config_mode_set(subsys, mode) < 0) {
-				error_reason = "unable to set mode to_logfile";
-				goto parse_error;
-			}
-		} else
-		if (strcmp (value, "no") == 0) {
-			mode &= ~LOGSYS_MODE_OUTPUT_FILE;
-			if (logsys_config_mode_set(subsys, mode) < 0) {
-				error_reason = "unable to unset mode to_logfile";
-				goto parse_error;
-			}
-		} else {
-			error_reason = "unknown value for to_logfile";
-			goto parse_error;
-		}
-	}
+	if (corosync_main_config_log_destination_set (objdb, object_handle, subsys, &error_reason,
+	    "to_stderr", LOGSYS_MODE_OUTPUT_STDERR, 0, NULL) != 0)
+		goto parse_error;
 
-	if (!objdb_get_string (objdb,object_handle, "to_syslog", &value)) {
-		if (strcmp (value, "yes") == 0) {
-			mode |= LOGSYS_MODE_OUTPUT_SYSLOG;
-			if (logsys_config_mode_set(subsys, mode) < 0) {
-				error_reason = "unable to set mode to_syslog";
-				goto parse_error;
-			}
-		} else
-		if (strcmp (value, "no") == 0) {
-			mode &= ~LOGSYS_MODE_OUTPUT_SYSLOG;
-			if (logsys_config_mode_set(subsys, mode) < 0) {
-				error_reason = "unable to unset mode to_syslog";
-				goto parse_error;
-			}
-		} else {
-			error_reason = "unknown value for to_syslog";
-			goto parse_error;
-		}
-	}
+	if (corosync_main_config_log_destination_set (objdb, object_handle, subsys, &error_reason,
+	    "to_syslog", LOGSYS_MODE_OUTPUT_SYSLOG, 0, NULL) != 0)
+		goto parse_error;
 
-	if (!objdb_get_string (objdb,object_handle, "to_stderr", &value)) {
-		if (strcmp (value, "yes") == 0) {
-			mode |= LOGSYS_MODE_OUTPUT_STDERR;
-			if (logsys_config_mode_set(subsys, mode) < 0) {
-				error_reason = "unable to set mode to_stderr";
-				goto parse_error;
-			}
-		} else
-		if (strcmp (value, "no") == 0) {
-			mode &= ~LOGSYS_MODE_OUTPUT_STDERR;
-			if (logsys_config_mode_set(subsys, mode) < 0) {
-				error_reason = "unable to unset mode to_stderr";
-				goto parse_error;
-			}
-		} else {
-			error_reason = "unknown value for to_syslog";
-			goto parse_error;
-		}
-	}
+	if (corosync_main_config_log_destination_set (objdb, object_handle, subsys, &error_reason,
+	    "to_file", LOGSYS_MODE_OUTPUT_FILE, 1, "to_logfile") != 0)
+		goto parse_error;
 
 	if (!objdb_get_string (objdb,object_handle, "syslog_facility", &value)) {
 		int syslog_facility;
@@ -584,34 +564,42 @@ parse_error:
 
 static int uid_determine (const char *req_user)
 {
-	struct passwd *passwd;
-	int ais_uid = 0;
-
-	passwd = getpwnam(req_user);
-	if (passwd == 0) {
-		log_printf (LOGSYS_LEVEL_ERROR, "ERROR: The '%s' user is not found in /etc/passwd, please read the documentation.\n", req_user);
+	struct passwd passwd;
+	struct passwd* pwdptr = &passwd;
+	struct passwd* temp_pwd_pt;
+	char pwdbuffer[200];
+	int  pwdlinelen = sizeof(pwdbuffer);
+
+	if ((getpwnam_r (req_user, pwdptr, pwdbuffer, pwdlinelen, &temp_pwd_pt)) != 0) {
+		log_printf (LOGSYS_LEVEL_ERROR,
+			"ERROR: The '%s' user is not found in /etc/passwd, please read the documentation.\n",
+			req_user);
 		corosync_exit_error (AIS_DONE_UID_DETERMINE);
 	}
-	ais_uid = passwd->pw_uid;
-	endpwent ();
-	return ais_uid;
+
+	return passwd.pw_uid;
 }
 
 static int gid_determine (const char *req_group)
 {
-	struct group *group;
 	int ais_gid = 0;
-
-	group = getgrnam (req_group);
-	if (group == 0) {
-		log_printf (LOGSYS_LEVEL_ERROR, "ERROR: The '%s' group is not found in /etc/group, please read the documentation.\n", req_group);
+	struct group group;
+	struct group * grpptr = &group;
+	struct group * temp_grp_pt;
+	char grpbuffer[200];
+	int  grplinelen = sizeof(grpbuffer);
+
+	if ((getgrnam_r (req_group, grpptr, grpbuffer, grplinelen, &temp_grp_pt)) != 0) {
+		log_printf (LOGSYS_LEVEL_ERROR,
+			"ERROR: The '%s' group is not found in /etc/group, please read the documentation.\n",
+			req_group);
 		corosync_exit_error (AIS_DONE_GID_DETERMINE);
 	}
-	ais_gid = group->gr_gid;
-	endgrent ();
+	ais_gid = group.gr_gid;
 	return ais_gid;
 }
 
+
 static void main_objdb_reload_notify(objdb_reload_notify_type_t type, int flush,
 				     void *priv_data_pt)
 {
diff --git a/exec/schedwrk.c b/exec/schedwrk.c
index 0c330e9..0591063 100644
--- a/exec/schedwrk.c
+++ b/exec/schedwrk.c
@@ -46,6 +46,7 @@ struct schedwrk_instance {
 	int (*schedwrk_fn) (const void *);
 	const void *context;
 	void *callback_handle;
+	int lock;
 };
 
 union u {
@@ -70,9 +71,13 @@ static int schedwrk_do (enum totem_callback_token_type type, const void *context
 		goto error_exit;
 	}
 
-	serialize_lock ();
+	if (instance->lock)
+		serialize_lock ();
+
 	res = instance->schedwrk_fn (instance->context);
-	serialize_unlock ();
+
+	if (instance->lock)
+		serialize_unlock ();
 
 	if (res == 0) {
 		hdb_handle_destroy (&schedwrk_instance_database, hdb_nocheck_convert (handle));
@@ -93,10 +98,11 @@ void schedwrk_init (
 	serialize_unlock = serialize_unlock_fn;
 }
 
-int schedwrk_create (
+static int schedwrk_internal_create (
 	hdb_handle_t *handle,
 	int (schedwrk_fn) (const void *),
-	const void *context)
+	const void *context,
+	int lock)
 {
 	struct schedwrk_instance *instance;
 	int res;
@@ -121,6 +127,7 @@ int schedwrk_create (
 
 	instance->schedwrk_fn = schedwrk_fn;
 	instance->context = context;
+	instance->lock = lock;
 
         hdb_handle_put (&schedwrk_instance_database, *handle);
 
@@ -133,6 +140,22 @@ error_exit:
 	return (-1);
 }
 
+int schedwrk_create (
+	hdb_handle_t *handle,
+	int (schedwrk_fn) (const void *),
+	const void *context)
+{
+	return schedwrk_internal_create (handle, schedwrk_fn, context, 1);
+}
+
+int schedwrk_create_nolock (
+	hdb_handle_t *handle,
+	int (schedwrk_fn) (const void *),
+	const void *context)
+{
+	return schedwrk_internal_create (handle, schedwrk_fn, context, 0);
+}
+
 void schedwrk_destroy (hdb_handle_t handle)
 {
 	hdb_handle_destroy (&schedwrk_instance_database, handle);
diff --git a/exec/schedwrk.h b/exec/schedwrk.h
index e67215b..68ce60d 100644
--- a/exec/schedwrk.h
+++ b/exec/schedwrk.h
@@ -34,15 +34,20 @@
 #ifndef SCHEDWRK_H_DEFINED
 #define SCHEDWRK_H_DEFINED
 
-void schedwrk_init (
+extern void schedwrk_init (
         void (*serialize_lock_fn) (void),
         void (*serialize_unlock_fn) (void));
 
-int schedwrk_create (
+extern int schedwrk_create (
         hdb_handle_t *handle,
         int (schedwrk_fn) (const void *),
         const void *context);
 
-void schedwrk_destroy (hdb_handle_t handle);
+extern int schedwrk_create_nolock (
+        hdb_handle_t *handle,
+        int (schedwrk_fn) (const void *),
+        const void *context);
+
+extern void schedwrk_destroy (hdb_handle_t handle);
 
 #endif /* SCHEDWRK_H_DEFINED */
diff --git a/exec/service.c b/exec/service.c
index d99e7bf..6c549fd 100644
--- a/exec/service.c
+++ b/exec/service.c
@@ -55,6 +55,8 @@
 #include <corosync/engine/coroapi.h>
 #include "service.h"
 
+#include <corosync/coroipcs.h>
+
 LOGSYS_DECLARE_SUBSYS ("SERV");
 
 struct default_service {
@@ -89,18 +91,29 @@ static struct default_service default_services[] = {
 	}
 };
 
+/*
+ * service exit and unlink schedwrk handler data structure
+ */
+struct seus_handler_data {
+	hdb_handle_t service_handle;
+	int service_engine;
+	struct corosync_api_v1 *api;
+};
+
 struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
 
 hdb_handle_t service_stats_handle[SERVICE_HANDLER_MAXIMUM_COUNT][64];
 
+int ais_service_exiting[SERVICE_HANDLER_MAXIMUM_COUNT];
+
 static hdb_handle_t object_internal_configuration_handle;
 
 static hdb_handle_t object_stats_services_handle;
 
 static void (*service_unlink_all_complete) (void) = NULL;
 
-static hdb_handle_t unlink_all_handle;
-
+static hdb_handle_t swrk_service_exit_handle;
+static hdb_handle_t swrk_service_unlink_handle;
 
 static unsigned int default_services_requested (struct corosync_api_v1 *corosync_api)
 {
@@ -272,7 +285,8 @@ corosync_service_unlink_priority (
 	struct corosync_api_v1 *corosync_api,
 	int lowest_priority,
 	int *current_priority,
-	int *current_service_engine)
+	int *current_service_engine,
+	hdb_handle_t *current_service_handle)
 {
 	unsigned short *service_id;
 	hdb_handle_t object_service_handle;
@@ -319,11 +333,6 @@ corosync_service_unlink_priority (
 							return (-1);
 						}
 					}
-					log_printf(LOGSYS_LEVEL_NOTICE,
-						"Service engine unloaded: %s\n",
-						   ais_service[*current_service_engine]->name);
-
-					ais_service[*current_service_engine] = NULL;
 
 					res = corosync_api->object_key_get (
 						object_service_handle,
@@ -331,17 +340,26 @@ corosync_service_unlink_priority (
 						(void *)&found_service_handle,
 						NULL);
 
-					lcr_ifact_release (*found_service_handle);
+					*current_service_handle = *found_service_handle;
+
+					ais_service_exiting[*current_service_engine] = 1;
 
-					corosync_api->object_destroy (object_service_handle);
-					break;
+					corosync_api->object_find_destroy (object_find_handle);
+
+					/*
+					 * Call should call this function again
+					 */
+					return (1);
 				}
 			}
 
 			corosync_api->object_find_destroy (object_find_handle);
 		}
 	}
-	return 0;
+	/*
+	 * We finish unlink of all services -> no need to call this function again
+	 */
+	return (0);
 }
 
 static unsigned int service_unlink_and_exit (
@@ -538,12 +556,46 @@ unsigned int corosync_service_defaults_link_and_init (struct corosync_api_v1 *co
 	return (0);
 }
 
-static int unlink_all_schedwrk_handler (const void *data) {
+/*
+ * Declaration of exit_schedwrk_handler, because of cycle
+ * (service_exit_schedwrk_handler calls service_unlink_schedwrk_handler, and vice-versa)
+ */
+static int service_exit_schedwrk_handler (const void *data);
+
+static int service_unlink_schedwrk_handler (const void *data) {
+	struct seus_handler_data *cb_data = (struct seus_handler_data *)data;
+	struct corosync_api_v1 *api = (struct corosync_api_v1 *)cb_data->api;
+
+	/*
+	 * Exit all ipc connections dependent on this service
+	 */
+	if (coroipcs_ipc_service_exit (cb_data->service_engine) == -1)
+		return -1;
+
+	log_printf(LOGSYS_LEVEL_NOTICE,
+		"Service engine unloaded: %s\n",
+		ais_service[cb_data->service_engine]->name);
+
+	ais_service[cb_data->service_engine] = NULL;
+
+	lcr_ifact_release (cb_data->service_handle);
+
+	api->schedwrk_create (
+		&swrk_service_exit_handle,
+		&service_exit_schedwrk_handler,
+		data);
+
+	return 0;
+}
+
+static int service_exit_schedwrk_handler (const void *data) {
 	int res;
 	static int current_priority = 0;
 	static int current_service_engine = 0;
 	static int called = 0;
-	struct corosync_api_v1 *api = (struct corosync_api_v1 *)data;
+	struct seus_handler_data *cb_data = (struct seus_handler_data *)data;
+	struct corosync_api_v1 *api = (struct corosync_api_v1 *)cb_data->api;
+	hdb_handle_t service_handle;
 
 	if (called == 0) {
 		log_printf(LOGSYS_LEVEL_NOTICE,
@@ -556,10 +608,25 @@ static int unlink_all_schedwrk_handler (const void *data) {
 		api,
 		0,
 		&current_priority,
-		&current_service_engine);
+		&current_service_engine,
+		&service_handle);
 	if (res == 0) {
 		service_unlink_all_complete();
+		return (res);
+	}
+
+	if (res == 1) {
+		cb_data->service_engine = current_service_engine;
+		cb_data->service_handle = service_handle;
+
+		api->schedwrk_create_nolock (
+			&swrk_service_unlink_handle,
+			&service_unlink_schedwrk_handler,
+			data);
+
+		return (0);
 	}
+
 	return (res);
 }
 		
@@ -568,6 +635,7 @@ void corosync_service_unlink_all (
 	void (*unlink_all_complete) (void))
 {
 	static int called = 0;
+	static struct seus_handler_data cb_data;
 
 	assert (api);
 
@@ -579,11 +647,13 @@ void corosync_service_unlink_all (
 	if (called == 0) {
 		called = 1;
 	}
-	
+
+	cb_data.api = api;
+
 	api->schedwrk_create (
-		&unlink_all_handle,
-		&unlink_all_schedwrk_handler,
-		api);
+		&swrk_service_exit_handle,
+		&service_exit_schedwrk_handler,
+		&cb_data);
 }
 
 struct service_unlink_and_exit_data {
diff --git a/exec/service.h b/exec/service.h
index efb3e44..2cc3399 100644
--- a/exec/service.h
+++ b/exec/service.h
@@ -58,8 +58,8 @@ extern unsigned int corosync_service_unlink_and_exit (
  * Unlink and exit all corosync services
  */
 extern void corosync_service_unlink_all (
-        struct corosync_api_v1 *api,
-        void (*unlink_all_complete) (void));
+	struct corosync_api_v1 *api,
+	void (*unlink_all_complete) (void));
 
 /*
  * Load all of the default services
@@ -69,6 +69,8 @@ extern unsigned int corosync_service_defaults_link_and_init (
 
 extern struct corosync_service_engine *ais_service[];
 
+extern int ais_service_exiting[];
+
 extern hdb_handle_t service_stats_handle[SERVICE_HANDLER_MAXIMUM_COUNT][64];
 
 #endif /* SERVICE_H_DEFINED */
diff --git a/exec/sync.c b/exec/sync.c
index cb3c300..ce115a3 100644
--- a/exec/sync.c
+++ b/exec/sync.c
@@ -99,8 +99,12 @@ static struct barrier_data barrier_data_process[PROCESSOR_COUNT_MAX];
 
 static unsigned int my_member_list[PROCESSOR_COUNT_MAX];
 
+static unsigned int my_trans_list[PROCESSOR_COUNT_MAX];
+
 static unsigned int my_member_list_entries;
 
+static unsigned int my_trans_list_entries;
+
 static int sync_barrier_send (const struct memb_ring_id *ring_id);
 
 static int sync_start_process (enum totem_callback_token_type type,
@@ -181,7 +185,14 @@ static void sync_start_init (const struct memb_ring_id *ring_id)
 
 static void sync_service_init (struct memb_ring_id *ring_id)
 {
-	sync_callbacks.sync_init (my_member_list, my_member_list_entries, ring_id);
+	if (sync_callbacks.api_version == 1) {
+		sync_callbacks.sync_init_api.sync_init_v1 (my_member_list,
+			my_member_list_entries, ring_id);
+	} else {
+		sync_callbacks.sync_init_api.sync_init_v2 (my_trans_list,
+			my_trans_list_entries,
+			my_member_list, my_member_list_entries, ring_id);
+	}
 	totempg_callback_token_destroy (&sync_callback_token_handle);
 
 	/*
@@ -227,7 +238,7 @@ static void sync_callbacks_load (void)
 			break;
 		}
 		sync_recovery_index += 1;
-		if (sync_callbacks.sync_init) {
+		if (sync_callbacks.sync_init_api.sync_init_v1) {
 			break;
 		}
 	}
@@ -434,7 +445,7 @@ static void sync_deliver_fn (
 		/*
 		 * if sync service found, execute it
 		 */
-		if (sync_processing && sync_callbacks.sync_init) {
+		if (sync_processing && sync_callbacks.sync_init_api.sync_init_v1) {
 			log_printf (LOGSYS_LEVEL_DEBUG,
 				"Synchronization actions starting for (%s)\n",
 				sync_callbacks.name);
@@ -460,6 +471,9 @@ static void sync_confchg_fn (
 	sync_ring_id = ring_id;
 
 	if (configuration_type != TOTEM_CONFIGURATION_REGULAR) {
+		memcpy (my_trans_list, member_list, member_list_entries *
+			sizeof (unsigned int));
+		my_trans_list_entries = member_list_entries;
 		return;
 	}
 	memcpy (my_member_list, member_list, member_list_entries * sizeof (unsigned int));
diff --git a/exec/sync.h b/exec/sync.h
index b642120..a8071d4 100644
--- a/exec/sync.h
+++ b/exec/sync.h
@@ -39,11 +39,23 @@
 #include <corosync/totem/totempg.h>
 #include "totemsrp.h"
 
-struct sync_callbacks {
-	void (*sync_init) (
+union sync_init_api {
+	void (*sync_init_v1) (
+		const unsigned int *member_list,
+		size_t member_list_entries,
+		const struct memb_ring_id *ring_id);
+
+	void (*sync_init_v2) (
+		const unsigned int *trans_list,
+		size_t trans_list_entries,
 		const unsigned int *member_list,
 		size_t member_list_entries,
 		const struct memb_ring_id *ring_id);
+};
+
+struct sync_callbacks {
+	int api_version;
+	union sync_init_api sync_init_api;
 	int (*sync_process) (void);
 	void (*sync_activate) (void);
 	void (*sync_abort) (void);
diff --git a/exec/syncv2.c b/exec/syncv2.c
index 3cdf52d..e0521f0 100644
--- a/exec/syncv2.c
+++ b/exec/syncv2.c
@@ -81,10 +81,8 @@ enum sync_state {
 
 struct service_entry {
 	int service_id;
-	void (*sync_init) (
-		const unsigned int *member_list,
-		size_t member_list_entries,
-		const struct memb_ring_id *ring_id);
+	int api_version;
+	union sync_init_api sync_init_api;
 	void (*sync_abort) (void);
 	int (*sync_process) (void);
 	void (*sync_activate) (void);
@@ -134,8 +132,12 @@ static struct processor_entry my_processor_list[PROCESSOR_COUNT_MAX];
 
 static unsigned int my_member_list[PROCESSOR_COUNT_MAX];
 
+static unsigned int my_trans_list[PROCESSOR_COUNT_MAX];
+
 static size_t my_member_list_entries = 0;
 
+static size_t my_trans_list_entries = 0;
+
 static int my_processor_list_entries = 0;
 
 static struct service_entry my_service_list[128];
@@ -202,7 +204,7 @@ int sync_v2_init (
 		if (res == -1) {
 			continue;
 		}
-		if (sync_callbacks.sync_init == NULL) {
+		if (sync_callbacks.sync_init_api.sync_init_v1 == NULL) {
 			continue;
 		}
 		my_initial_service_list[my_initial_service_list_entries].state =
@@ -210,7 +212,8 @@ int sync_v2_init (
 		my_initial_service_list[my_initial_service_list_entries].service_id = i;
 		strcpy (my_initial_service_list[my_initial_service_list_entries].name,
 			sync_callbacks.name);
-		my_initial_service_list[my_initial_service_list_entries].sync_init = sync_callbacks.sync_init;
+		my_initial_service_list[my_initial_service_list_entries].api_version = sync_callbacks.api_version;
+		my_initial_service_list[my_initial_service_list_entries].sync_init_api = sync_callbacks.sync_init_api;
 		my_initial_service_list[my_initial_service_list_entries].sync_process = sync_callbacks.sync_process;
 		my_initial_service_list[my_initial_service_list_entries].sync_abort = sync_callbacks.sync_abort;
 		my_initial_service_list[my_initial_service_list_entries].sync_activate = sync_callbacks.sync_activate;
@@ -334,7 +337,8 @@ static void sync_service_build_handler (unsigned int nodeid, const void *msg)
 			sprintf (my_service_list[my_service_list_entries].name,
 				"External Service (id = %d)\n",
 				req_exec_service_build_message->service_list[i]);
-			my_service_list[my_service_list_entries].sync_init =
+			my_service_list[my_service_list_entries].api_version = 1;
+			my_service_list[my_service_list_entries].sync_init_api.sync_init_v1 =
 				dummy_sync_init;
 			my_service_list[my_service_list_entries].sync_abort =
 				dummy_sync_abort;
@@ -510,13 +514,39 @@ static void sync_servicelist_build_enter (
 
 static int schedwrk_processor (const void *context)
 {
-	int res;
+	int res = 0;
 
 	if (my_service_list[my_processing_idx].state == INIT) {
 		my_service_list[my_processing_idx].state = PROCESS;
-		my_service_list[my_processing_idx].sync_init (my_member_list,
-			my_member_list_entries,
-			&my_ring_id);
+		if (my_service_list[my_processing_idx].api_version == 1) {
+			my_service_list[my_processing_idx].sync_init_api.sync_init_v1 (my_member_list,
+				my_member_list_entries,
+				&my_ring_id);
+		} else {
+			unsigned int old_trans_list[PROCESSOR_COUNT_MAX];
+			size_t old_trans_list_entries = 0;
+			int o, m;
+
+			memcpy (old_trans_list, my_trans_list, my_trans_list_entries *
+				sizeof (unsigned int));
+			old_trans_list_entries = my_trans_list_entries;
+
+			my_trans_list_entries = 0;
+			for (o = 0; o < old_trans_list_entries; o++) {
+				for (m = 0; m < my_member_list_entries; m++) {
+					if (old_trans_list[o] == my_member_list[m]) {
+						my_trans_list[my_trans_list_entries] = my_member_list[m];
+						my_trans_list_entries++;
+						break;
+					}
+				}
+			}
+
+			my_service_list[my_processing_idx].sync_init_api.sync_init_v2 (my_trans_list,
+				my_trans_list_entries, my_member_list,
+				my_member_list_entries,
+				&my_ring_id);
+		}
 	}
 	if (my_service_list[my_processing_idx].state == PROCESS) {
 		my_service_list[my_processing_idx].state = PROCESS;
@@ -554,6 +584,17 @@ void sync_v2_start (
 	}
 }
 
+void sync_v2_save_transitional (
+        const unsigned int *member_list,
+        size_t member_list_entries,
+        const struct memb_ring_id *ring_id)
+{
+	log_printf (LOGSYS_LEVEL_DEBUG, "saving transitional configuration\n");
+	memcpy (my_trans_list, member_list, member_list_entries *
+		sizeof (unsigned int));
+	my_trans_list_entries = member_list_entries;
+}
+
 void sync_v2_abort (void)
 {
 	if (my_state == SYNC_PROCESS) {
diff --git a/exec/syncv2.h b/exec/syncv2.h
index c383636..91b9aff 100644
--- a/exec/syncv2.h
+++ b/exec/syncv2.h
@@ -48,6 +48,11 @@ extern void sync_v2_start (
         size_t member_list_entries,
         const struct memb_ring_id *ring_id);
 
+extern void sync_v2_save_transitional (
+        const unsigned int *member_list,
+        size_t member_list_entries,
+        const struct memb_ring_id *ring_id);
+
 extern void sync_v2_abort (void);
 
 extern void sync_v2_memb_list_determine (const struct memb_ring_id *ring_id);
diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index de02c77..e6ba941 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -559,7 +559,7 @@ int totem_config_validate (
 		goto parse_error;
 	}
 
-	if (totem_config->consensus_timeout <= 1.2 * totem_config->token_timeout) {
+	if (totem_config->consensus_timeout < 1.2 * totem_config->token_timeout) {
 		snprintf (local_error_reason, sizeof(local_error_reason),
 			"The consensus timeout parameter (%d ms) must be atleast 1.2 * token (%d ms).",
 			totem_config->consensus_timeout, (int) ((float)1.2 * totem_config->token_timeout));
@@ -690,12 +690,14 @@ static int read_keyfile (
 	int res;
 	ssize_t expected_key_len = sizeof (totem_config->private_key);
 	int saved_errno;
+	char error_str[100];
 
 	fd = open (key_location, O_RDONLY);
 	if (fd == -1) {
+		strerror_r (errno, error_str, 100);
 		snprintf (error_string_response, sizeof(error_string_response),
 			"Could not open %s: %s\n",
-			 key_location, strerror (errno));
+			 key_location, error_str);
 		goto parse_error;
 	}
 
@@ -704,9 +706,10 @@ static int read_keyfile (
 	close (fd);
 
 	if (res == -1) {
+		strerror_r (errno, error_str, 100);
 		snprintf (error_string_response, sizeof(error_string_response),
 			"Could not read %s: %s\n",
-			 key_location, strerror (saved_errno));
+			 key_location, error_str);
 		goto parse_error;
 	}
 
diff --git a/exec/totemip.c b/exec/totemip.c
index 9e1bc44..f6613e8 100644
--- a/exec/totemip.c
+++ b/exec/totemip.c
@@ -447,6 +447,25 @@ int totemip_iface_check(struct totem_ip_address *bindnet,
 			 */
 			*interface_up = ifa->ifa_flags & IFF_UP;
 			*interface_num = if_nametoindex(ifa->ifa_name);
+
+			/*
+			 * Handle case, when nodeid is set to 0 or not set.
+			 */
+			if (bindnet->family == AF_INET && bindnet->nodeid == 0) {
+				unsigned int nodeid = 0;
+				memcpy (&nodeid, boundto->addr, sizeof (int));
+#if _BYTE_ORDER == _BIG_ENDIAN
+				nodeid = swab32 (nodeid);
+#endif
+				/*
+				 * Mask 32nd bit off to workaround bugs in other peoples code
+				 * (if configuration requests it).
+				 */
+				if (mask_high_bit) {
+					nodeid &= 0x7FFFFFFF;
+				}
+				boundto->nodeid = nodeid;
+			}
 			res = 0;
 			break; /* for */
 		}
diff --git a/exec/totemsrp.c b/exec/totemsrp.c
index a96a3e8..58fb8e5 100644
--- a/exec/totemsrp.c
+++ b/exec/totemsrp.c
@@ -479,8 +479,6 @@ struct totemsrp_instance {
 
 	unsigned int old_ring_state_high_seq_received;
 
-	int ring_saved;
-
 	unsigned int my_last_seq;
 
 	struct timeval tv_old;
@@ -1299,10 +1297,15 @@ static void memb_set_merge (
 	return;
 }
 
-static void memb_set_and (
-        struct srp_addr *set1, int set1_entries,
-        struct srp_addr *set2, int set2_entries,
-        struct srp_addr *and, int *and_entries)
+static void memb_set_and_with_ring_id (
+	struct srp_addr *set1,
+	struct memb_ring_id *set1_ring_ids,
+	int set1_entries,
+	struct srp_addr *set2,
+	int set2_entries,
+	struct memb_ring_id *old_ring_id,
+	struct srp_addr *and,
+	int *and_entries)
 {
 	int i;
 	int j;
@@ -1313,7 +1316,9 @@ static void memb_set_and (
 	for (i = 0; i < set2_entries; i++) {
 		for (j = 0; j < set1_entries; j++) {
 			if (srp_addr_equal (&set1[j], &set2[i])) {
-				found = 1;
+				if (memcmp (&set1_ring_ids[j], old_ring_id, sizeof (struct memb_ring_id)) == 0) {
+					found = 1;
+				}
 				break;
 			}
 		}
@@ -1393,20 +1398,6 @@ static void old_ring_state_save (struct totemsrp_instance *instance)
 	}
 }
 
-static void ring_save (struct totemsrp_instance *instance)
-{
-	if (instance->ring_saved == 0) {
-		instance->ring_saved = 1;
-		memcpy (&instance->my_old_ring_id, &instance->my_ring_id,
-			sizeof (struct memb_ring_id));
-	}
-}
-
-static void ring_reset (struct totemsrp_instance *instance)
-{
-	instance->ring_saved = 0;
-}
-
 static void ring_state_restore (struct totemsrp_instance *instance)
 {
 	if (instance->old_ring_state_saved) {
@@ -1694,7 +1685,7 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance)
 	memb_consensus_reset (instance);
 
 	old_ring_state_reset (instance);
-	ring_reset (instance);
+
 	deliver_messages_from_recovery_to_regular (instance);
 
 	log_printf (instance->totemsrp_log_level_debug,
@@ -1794,6 +1785,14 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance)
 
 	reset_pause_timeout (instance);
 
+	/*
+	 * Save ring id information from this configuration to determine
+	 * which processors are transitioning from old regular configuration
+	 * in to new regular configuration on the next configuration change
+	 */
+	memcpy (&instance->my_old_ring_id, &instance->my_ring_id,
+		sizeof (struct memb_ring_id));
+
 	return;
 }
 
@@ -1804,7 +1803,6 @@ static void memb_state_gather_enter (
 	memb_set_merge (
 		&instance->my_id, 1,
 		instance->my_proc_list, &instance->my_proc_list_entries);
-	assert (srp_addr_equal (&instance->my_proc_list[0], &instance->my_proc_list[1]) == 0);
 
 	memb_join_message_send (instance);
 
@@ -1865,8 +1863,6 @@ static void target_set_completed (
 static void memb_state_commit_enter (
 	struct totemsrp_instance *instance)
 {
-	ring_save (instance);
-
 	old_ring_state_save (instance);
 
 	memb_state_commit_token_update (instance);
@@ -1916,6 +1912,7 @@ static void memb_state_recovery_enter (
 	unsigned int messages_originated = 0;
 	const struct srp_addr *addr;
 	struct memb_commit_token_memb_entry *memb_list;
+	struct memb_ring_id my_new_memb_ring_id_list[PROCESSOR_COUNT_MAX];
 
 	addr = (const struct srp_addr *)commit_token->end_of_commit_token;
 	memb_list = (struct memb_commit_token_memb_entry *)(addr + commit_token->addr_entries);
@@ -1937,17 +1934,32 @@ static void memb_state_recovery_enter (
 	/*
 	 * Build regular configuration
 	 */
- 	totemrrp_processor_count_set (
+	totemrrp_processor_count_set (
 		instance->totemrrp_context,
 		commit_token->addr_entries);
 
 	/*
 	 * Build transitional configuration
 	 */
-	memb_set_and (instance->my_new_memb_list, instance->my_new_memb_entries,
-		instance->my_memb_list, instance->my_memb_entries,
-		instance->my_trans_memb_list, &instance->my_trans_memb_entries);
-
+	for (i = 0; i < instance->my_new_memb_entries; i++) {
+		memcpy (&my_new_memb_ring_id_list[i],
+			&memb_list[i].ring_id,
+			sizeof (struct memb_ring_id));
+	}
+	memb_set_and_with_ring_id (
+		instance->my_new_memb_list,
+		my_new_memb_ring_id_list,
+		instance->my_new_memb_entries,
+		instance->my_memb_list,
+		instance->my_memb_entries,
+		&instance->my_old_ring_id,
+		instance->my_trans_memb_list,
+		&instance->my_trans_memb_entries);
+
+	for (i = 0; i < instance->my_trans_memb_entries; i++) {
+		log_printf (instance->totemsrp_log_level_debug,
+			"TRANS [%d] member %s:\n", i, totemip_print (&instance->my_trans_memb_list[i].addr[0]));
+	}
 	for (i = 0; i < instance->my_new_memb_entries; i++) {
 		log_printf (instance->totemsrp_log_level_debug,
 			"position [%d] member %s:\n", i, totemip_print (&addr[i].addr[0]));
@@ -2463,7 +2475,7 @@ static int orf_token_rtr (
 	 * but only retry if there is room in the retransmit list
 	 */
 
-	range = instance->my_high_seq_received - instance->my_aru;
+	range = orf_token->seq - instance->my_aru;
 	assert (range < QUEUE_RTR_ITEMS_SIZE_MAX);
 
 	for (i = 1; (orf_token->rtr_list_entries < RETRANSMIT_ENTRIES_MAX) &&
@@ -2615,6 +2627,7 @@ static int token_hold_cancel_send (struct totemsrp_instance *instance)
 	 */
 	token_hold_cancel.header.type = MESSAGE_TYPE_TOKEN_HOLD_CANCEL;
 	token_hold_cancel.header.endian_detector = ENDIAN_LOCAL;
+	token_hold_cancel.header.encapsulated = 0;
 	token_hold_cancel.header.nodeid = instance->my_id.addr[0].nodeid;
 	memcpy (&token_hold_cancel.ring_id, &instance->my_ring_id,
 		sizeof (struct memb_ring_id));
@@ -2685,7 +2698,6 @@ static void memb_state_commit_token_update (
 
 	memcpy (&memb_list[instance->commit_token->memb_index].ring_id,
 		&instance->my_old_ring_id, sizeof (struct memb_ring_id));
-	assert (!totemip_zero_check(&instance->my_old_ring_id.rep));
 
 	memb_list[instance->commit_token->memb_index].aru = instance->old_ring_state_aru;
 	/*
@@ -2910,7 +2922,6 @@ static void memb_join_message_send (struct totemsrp_instance *instance)
 	memb_join->header.nodeid = instance->my_id.addr[0].nodeid;
 	assert (memb_join->header.nodeid);
 
-	assert (srp_addr_equal (&instance->my_proc_list[0], &instance->my_proc_list[1]) == 0);
 	memb_join->ring_seq = instance->my_ring_id.seq;
 	memb_join->proc_list_entries = instance->my_proc_list_entries;
 	memb_join->failed_list_entries = instance->my_failed_list_entries;
@@ -3060,15 +3071,19 @@ static void memb_ring_id_create_or_load (
 		umask(0);
 		fd = open (filename, O_CREAT|O_RDWR, 0700);
 		if (fd == -1) {
+			char error_str[100];
+			strerror_r(errno, error_str, 100);
 			log_printf (instance->totemsrp_log_level_warning,
-				"Couldn't create %s %s\n", filename, strerror (errno));
+				"Couldn't create %s %s\n", filename, error_str);
 		}
 		res = write (fd, &memb_ring_id->seq, sizeof (unsigned long long));
 		assert (res == sizeof (unsigned long long));
 		close (fd);
 	} else {
+		char error_str[100];
+		strerror_r(errno, error_str, 100);
 		log_printf (instance->totemsrp_log_level_warning,
-			"Couldn't open %s %s\n", filename, strerror (errno));
+			"Couldn't open %s %s\n", filename, error_str);
 	}
 
 	totemip_copy(&memb_ring_id->rep, &instance->my_id.addr[0]);
@@ -3094,9 +3109,11 @@ static void memb_ring_id_set_and_store (
 		fd = open (filename, O_CREAT|O_RDWR, 0777);
 	}
 	if (fd == -1) {
+		char error_str[100];
+		strerror_r(errno, error_str, 100);
 		log_printf (instance->totemsrp_log_level_warning,
 			"Couldn't store new ring id %llx to stable storage (%s)\n",
-				instance->my_ring_id.seq, strerror (errno));
+				instance->my_ring_id.seq, error_str);
 		assert (0);
 		return;
 	}
diff --git a/exec/totemudp.c b/exec/totemudp.c
index 8425023..33c543c 100644
--- a/exec/totemudp.c
+++ b/exec/totemudp.c
@@ -1385,10 +1385,14 @@ static void timer_function_netif_check_timeout (
 static void totemudp_traffic_control_set(struct totemudp_instance *instance, int sock)
 {
 #ifdef SO_PRIORITY
-    int prio = 6; /* TC_PRIO_INTERACTIVE */
-
-    if (setsockopt(sock, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(int)))
-		log_printf (instance->totemudp_log_level_warning, "Could not set traffic priority. (%s)\n", strerror (errno));
+	int prio = 6; /* TC_PRIO_INTERACTIVE */
+	char error_str[100];
+
+	if (setsockopt(sock, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(int))) {
+		strerror_r (errno, error_str, 100);
+		log_printf (instance->totemudp_log_level_warning,
+			"Could not set traffic priority. (%s)\n", error_str);
+    }
 #endif
 }
 
@@ -1426,7 +1430,10 @@ static int totemudp_build_sockets_ip (
 	totemip_nosigpipe (sockets->mcast_recv);
 	res = fcntl (sockets->mcast_recv, F_SETFL, O_NONBLOCK);
 	if (res == -1) {
-		log_printf (instance->totemudp_log_level_warning, "Could not set non-blocking operation on multicast socket: %s\n", strerror (errno));
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
+		log_printf (instance->totemudp_log_level_warning,
+			"Could not set non-blocking operation on multicast socket: %s\n", error_str);
 		return (-1);
 	}
 
@@ -1462,7 +1469,10 @@ static int totemudp_build_sockets_ip (
 	totemip_nosigpipe (sockets->mcast_send);
 	res = fcntl (sockets->mcast_send, F_SETFL, O_NONBLOCK);
 	if (res == -1) {
-		log_printf (instance->totemudp_log_level_warning, "Could not set non-blocking operation on multicast socket: %s\n", strerror (errno));
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
+		log_printf (instance->totemudp_log_level_warning,
+			"Could not set non-blocking operation on multicast socket: %s\n", error_str);
 		return (-1);
 	}
 
@@ -1495,7 +1505,10 @@ static int totemudp_build_sockets_ip (
 	totemip_nosigpipe (sockets->token);
 	res = fcntl (sockets->token, F_SETFL, O_NONBLOCK);
 	if (res == -1) {
-		log_printf (instance->totemudp_log_level_warning, "Could not set non-blocking operation on token socket: %s\n", strerror (errno));
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
+		log_printf (instance->totemudp_log_level_warning,
+			"Could not set non-blocking operation on token socket: %s\n", error_str);
 		return (-1);
 	}
 
@@ -1777,6 +1790,7 @@ int totemudp_initialize (
 	instance->totemudp_target_set_completed = target_set_completed;
 
 	totemip_localhost (instance->mcast_address.family, &localhost);
+	localhost.nodeid = instance->totem_config->node_id;
 
 	/*
 	 * RRP layer isn't ready to receive message because it hasn't
diff --git a/exec/util.c b/exec/util.c
index c621ec0..a0a929a 100644
--- a/exec/util.c
+++ b/exec/util.c
@@ -94,6 +94,7 @@ void _corosync_exit_error (
 		"with status %d at %s:%u.\n", err, file, line);
 	logsys_fork_completed ();
 	logsys_flush ();
+	logsys_atexit ();
 	exit (err);
 }
 
diff --git a/exec/vsf_quorum.c b/exec/vsf_quorum.c
index 4d94ee9..4db696c 100644
--- a/exec/vsf_quorum.c
+++ b/exec/vsf_quorum.c
@@ -135,11 +135,12 @@ static void quorum_api_set_quorum(const unsigned int *view_list,
 				  size_t view_list_entries,
 				  int quorum, struct memb_ring_id *ring_id)
 {
+	int old_quorum = primary_designated;
 	primary_designated = quorum;
 
-	if (primary_designated) {
+	if (primary_designated && !old_quorum) {
 		log_printf (LOGSYS_LEVEL_NOTICE, "This node is within the primary component and will provide service.\n");
-	} else {
+	} else if (!primary_designated && old_quorum) {
 		log_printf (LOGSYS_LEVEL_NOTICE, "This node is within the non-primary component and will NOT provide any services.\n");
 	}
 
diff --git a/include/corosync/coroipcs.h b/include/corosync/coroipcs.h
index 3838af8..f08f0e5 100644
--- a/include/corosync/coroipcs.h
+++ b/include/corosync/coroipcs.h
@@ -152,6 +152,8 @@ extern void coroipcs_refcount_dec (void *conn);
 
 extern void coroipcs_ipc_exit (void);
 
+extern int coroipcs_ipc_service_exit (unsigned int service);
+
 extern int coroipcs_handler_accept (
 	int fd,
 	int revent,
diff --git a/include/corosync/engine/coroapi.h b/include/corosync/engine/coroapi.h
index 0c487ca..7639ab1 100644
--- a/include/corosync/engine/coroapi.h
+++ b/include/corosync/engine/coroapi.h
@@ -136,8 +136,9 @@ enum cs_flow_control_state {
 #endif /* COROSYNC_FLOW_CONTROL_STATE */
 
 enum cs_sync_mode {
-	CS_SYNC_V1	= 0,
-	CS_SYNC_V2	= 1
+	CS_SYNC_V1	 = 0,
+	CS_SYNC_V2	 = 1,
+	CS_SYNC_V1_APIV2 = 2
 };
 
 typedef enum {
@@ -627,6 +628,11 @@ struct corosync_api_v1 {
 		objdb_value_types_t *type);
 
 	void *(*totem_get_stats)(void);
+
+	int (*schedwrk_create_nolock) (
+		hdb_handle_t *handle,
+		int (schedwrk_fn) (const void *),
+		const void *context);
 };
 
 #define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )
@@ -647,6 +653,11 @@ struct corosync_service_engine_iface_ver0 {
         struct corosync_service_engine *(*corosync_get_service_engine_ver0) (void);
 };
 
+typedef void (*sync_init_v1_fn_t) (
+		const unsigned int *member_list,
+		size_t member_list_entries,
+		const struct memb_ring_id *ring_id) ;
+
 struct corosync_service_engine {
 	const char *name;
 	unsigned short id;
@@ -673,10 +684,7 @@ struct corosync_service_engine {
 		const unsigned int *joined_list, size_t joined_list_entries,
 		const struct memb_ring_id *ring_id);
 	enum cs_sync_mode sync_mode;
-	void (*sync_init) (
-		const unsigned int *member_list,
-		size_t member_list_entries,
-		const struct memb_ring_id *ring_id);
+	sync_init_v1_fn_t sync_init;
 	int (*sync_process) (void);
 	void (*sync_activate) (void);
 	void (*sync_abort) (void);
diff --git a/include/corosync/ipc_cpg.h b/include/corosync/ipc_cpg.h
index 7df1891..8f55ae8 100644
--- a/include/corosync/ipc_cpg.h
+++ b/include/corosync/ipc_cpg.h
@@ -47,7 +47,8 @@ enum req_cpg_types {
 	MESSAGE_REQ_CPG_LOCAL_GET = 4,
 	MESSAGE_REQ_CPG_ITERATIONINITIALIZE = 5,
 	MESSAGE_REQ_CPG_ITERATIONNEXT = 6,
-	MESSAGE_REQ_CPG_ITERATIONFINALIZE = 7
+	MESSAGE_REQ_CPG_ITERATIONFINALIZE = 7,
+	MESSAGE_REQ_CPG_FINALIZE = 8
 };
 
 enum res_cpg_types {
@@ -63,6 +64,7 @@ enum res_cpg_types {
 	MESSAGE_RES_CPG_ITERATIONINITIALIZE = 9,
 	MESSAGE_RES_CPG_ITERATIONNEXT = 10,
 	MESSAGE_RES_CPG_ITERATIONFINALIZE = 11,
+	MESSAGE_RES_CPG_FINALIZE = 12,
 };
 
 enum lib_cpg_confchg_reason {
@@ -157,6 +159,14 @@ struct res_lib_cpg_join {
 	coroipc_response_header_t header __attribute__((aligned(8)));
 };
 
+struct req_lib_cpg_finalize {
+	coroipc_request_header_t header __attribute__((aligned(8)));
+};
+
+struct res_lib_cpg_finalize {
+	coroipc_response_header_t header __attribute__((aligned(8)));
+};
+
 struct req_lib_cpg_trackstart {
 	coroipc_request_header_t header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
diff --git a/init/generic.in b/init/generic.in
index 12236c1..261ceaf 100755
--- a/init/generic.in
+++ b/init/generic.in
@@ -62,6 +62,15 @@ if [ -d @SYSCONFDIR@/default ]; then
 	[ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
 fi
 
+# The version of __pids_pidof in /etc/init.d/functions calls pidof with -x
+# This means it matches scripts, including this one.
+# Redefine it here so that status (from the same file) works.
+# Otherwise simultaneous calls to stop() will loop forever
+__pids_pidof() {
+        pidof -c -o $$ -o $PPID -o %PPID "$1" || \
+                pidof -c -o $$ -o $PPID -o %PPID "${1##*/}"
+}
+
 start()
 {
 	echo -n "Starting $desc ($prog): "
diff --git a/lcr/lcr_ifact.c b/lcr/lcr_ifact.c
index 6c8c912..f114296 100644
--- a/lcr/lcr_ifact.c
+++ b/lcr/lcr_ifact.c
@@ -285,17 +285,29 @@ static int scandir (
 	int (*compar)(const struct dirent **, const struct dirent **))
 {
 	DIR *d;
-	struct dirent *entry, **names = NULL;
+	struct dirent *entry;
+	struct dirent *result;
+	struct dirent **names = NULL;
 	int namelist_items = 0, namelist_size = 0;
+	size_t len;
+	int return_code;
 
 	d = opendir(dir);
 	if (d == NULL)
 		return -1;
 
 	names = NULL;
-	while ((entry = readdir (d)) != NULL) {
+
+	len = offsetof(struct dirent, d_name) +
+                     pathconf(dir, _PC_NAME_MAX) + 1;
+	entry = malloc(len);
+
+	for (return_code = readdir_r (d, entry, &result);
+		dirent != NULL && return_code == 0;
+		return_code = readdir_r(d, entry, &result)) {
+
 		struct dirent *tmpentry;
-		if ((filter != NULL) && ((*filter)(entry) == 0)) {
+		if ((filter != NULL) && ((*filter)(result) == 0)) {
 			continue;
 		}
 		if (namelist_items >= namelist_size) {
@@ -312,11 +324,11 @@ static int scandir (
 			}
 			names = tmp;
 		}
-		tmpentry = malloc (entry->d_reclen);
+		tmpentry = malloc (result->d_reclen);
 		if (tmpentry == NULL) {
 			goto fail;
 		}
-		(void) memcpy (tmpentry, entry, entry->d_reclen);
+		(void) memcpy (tmpentry, result, result->d_reclen);
 		names[namelist_items++] = tmpentry;
 	}
 	(void) closedir (d);
@@ -337,6 +349,7 @@ fail:
 		namelist_items--;
 		free (*namelist[namelist_items]);
 	}
+	free (entry);
 	free (names);
 	*namelist = NULL;
 	errno = err;
diff --git a/lcr/uis.c b/lcr/uis.c
index 6431c7f..004c464 100755
--- a/lcr/uis.c
+++ b/lcr/uis.c
@@ -96,7 +96,9 @@ static void uis_lcr_bind (int *server_fd)
 
 	res = bind (fd, (struct sockaddr *)&un_addr, AIS_SUN_LEN(&un_addr));
 	if (res) {
-		printf ("Could not bind AF_UNIX: %s\n", strerror (errno));
+		char error_str[100];
+		strerror_r (errno, error_str, 100);
+		printf ("Could not bind AF_UNIX: %s\n", error_str);
 	}
 	listen (fd, SERVER_BACKLOG);
 	*server_fd = fd;
diff --git a/lib/coroipcc.c b/lib/coroipcc.c
index aa9546c..e0ec66b 100644
--- a/lib/coroipcc.c
+++ b/lib/coroipcc.c
@@ -71,6 +71,11 @@
 
 #include "util.h"
 
+/*
+ * Define sem_wait timeout (real timeout will be (n-1;n) )
+ */
+#define IPC_SEMWAIT_TIMEOUT 2
+
 struct ipc_instance {
 	int fd;
 #if _POSIX_THREAD_PROCESS_SHARED < 1
@@ -456,13 +461,31 @@ reply_receive (
 {
 #if _POSIX_THREAD_PROCESS_SHARED < 1
 	struct sembuf sop;
+#else
+	struct timespec timeout;
+	struct pollfd pfd;
 #endif
 	coroipc_response_header_t *response_header;
 	int res;
 
 #if _POSIX_THREAD_PROCESS_SHARED > 0
 retry_semwait:
-	res = sem_wait (&ipc_instance->control_buffer->sem1);
+	timeout.tv_sec = time(NULL) + IPC_SEMWAIT_TIMEOUT;
+	timeout.tv_nsec = 0;
+
+	res = sem_timedwait (&ipc_instance->control_buffer->sem1, &timeout);
+	if (res == -1 && errno == ETIMEDOUT) {
+		pfd.fd = ipc_instance->fd;
+		pfd.events = 0;
+
+		poll (&pfd, 1, 0);
+		if (pfd.revents == POLLERR || pfd.revents == POLLHUP) {
+			return (CS_ERR_LIBRARY);
+		}
+
+		goto retry_semwait;
+	}
+
 	if (res == -1 && errno == EINTR) {
 		goto retry_semwait;
 	}
@@ -505,12 +528,30 @@ reply_receive_in_buf (
 {
 #if _POSIX_THREAD_PROCESS_SHARED < 1
 	struct sembuf sop;
+#else
+	struct timespec timeout;
+	struct pollfd pfd;
 #endif
 	int res;
 
 #if _POSIX_THREAD_PROCESS_SHARED > 0
 retry_semwait:
-	res = sem_wait (&ipc_instance->control_buffer->sem1);
+	timeout.tv_sec = time(NULL) + IPC_SEMWAIT_TIMEOUT;
+	timeout.tv_nsec = 0;
+
+	res = sem_timedwait (&ipc_instance->control_buffer->sem1, &timeout);
+	if (res == -1 && errno == ETIMEDOUT) {
+		pfd.fd = ipc_instance->fd;
+		pfd.events = 0;
+
+		poll (&pfd, 1, 0);
+		if (pfd.revents == POLLERR || pfd.revents == POLLHUP) {
+			return (CS_ERR_LIBRARY);
+		}
+
+		goto retry_semwait;
+	}
+
 	if (res == -1 && errno == EINTR) {
 		goto retry_semwait;
 	}
@@ -609,8 +650,8 @@ coroipcc_service_connect (
 	sys_res = connect (request_fd, (struct sockaddr *)&address,
 		COROSYNC_SUN_LEN(&address));
 	if (sys_res == -1) {
-		close (request_fd);
-		return (CS_ERR_TRY_AGAIN);
+		res = CS_ERR_TRY_AGAIN;
+		goto error_connect;
 	}
 
 	res = memory_map (
@@ -618,24 +659,40 @@ coroipcc_service_connect (
 		"control_buffer-XXXXXX",
 		(void *)&ipc_instance->control_buffer,
 		8192);
+	if (res == -1) {
+		res = CS_ERR_LIBRARY;
+		goto error_connect;
+	}
 
 	res = memory_map (
 		request_map_path,
 		"request_buffer-XXXXXX",
 		(void *)&ipc_instance->request_buffer,
 		request_size);
+	if (res == -1) {
+		res = CS_ERR_LIBRARY;
+		goto error_request_buffer;
+	}
 
 	res = memory_map (
 		response_map_path,
 		"response_buffer-XXXXXX",
 		(void *)&ipc_instance->response_buffer,
 		response_size);
+	if (res == -1) {
+		res = CS_ERR_LIBRARY;
+		goto error_response_buffer;
+	}
 
 	res = circular_memory_map (
 		dispatch_map_path,
 		"dispatch_buffer-XXXXXX",
 		(void *)&ipc_instance->dispatch_buffer,
 		dispatch_size);
+	if (res == -1) {
+		res = CS_ERR_LIBRARY;
+		goto error_dispatch_buffer;
+	}
 
 #if _POSIX_THREAD_PROCESS_SHARED > 0
 	sem_init (&ipc_instance->control_buffer->sem0, 1, 0);
@@ -661,19 +718,19 @@ coroipcc_service_connect (
 		 * an existing shared memory segment for which we have access
 		 */
 		if (errno != EEXIST && errno != EACCES) {
-			goto res_exit;
+			goto error_exit;
 		}
 	}
 
 	semun.val = 0;
 	res = semctl (ipc_instance->semid, 0, SETVAL, semun);
 	if (res != 0) {
-		goto res_exit;
+		goto error_exit;
 	}
 
 	res = semctl (ipc_instance->semid, 1, SETVAL, semun);
 	if (res != 0) {
-		goto res_exit;
+		goto error_exit;
 	}
 #endif
 
@@ -696,18 +753,19 @@ coroipcc_service_connect (
 
 	res = socket_send (request_fd, &req_setup, sizeof (mar_req_setup_t));
 	if (res != CS_OK) {
-		goto res_exit;
+		goto error_exit;
 	}
 	res = socket_recv (request_fd, &res_setup, sizeof (mar_res_setup_t));
 	if (res != CS_OK) {
-		goto res_exit;
+		goto error_exit;
 	}
 
 	ipc_instance->fd = request_fd;
 	ipc_instance->flow_control_state = 0;
 
 	if (res_setup.error == CS_ERR_TRY_AGAIN) {
-		goto res_exit;
+		res = res_setup.error;
+		goto error_exit;
 	}
 
 	ipc_instance->control_size = 8192;
@@ -721,13 +779,25 @@ coroipcc_service_connect (
 
 	return (res_setup.error);
 
-res_exit:
-	close (request_fd);
+error_exit:
 #if _POSIX_THREAD_PROCESS_SHARED < 1
 	if (ipc_instance->semid > 0)
 		semctl (ipc_instance->semid, 0, IPC_RMID);
 #endif
-	return (res_setup.error);
+	memory_unmap (ipc_instance->dispatch_buffer, dispatch_size);
+error_dispatch_buffer:
+	memory_unmap (ipc_instance->response_buffer, response_size);
+error_response_buffer:
+	memory_unmap (ipc_instance->request_buffer, request_size);
+error_request_buffer:
+	memory_unmap (ipc_instance->control_buffer, 8192);
+error_connect:
+	close (request_fd);
+
+	hdb_handle_destroy (&ipc_hdb, *handle);
+	hdb_handle_put (&ipc_hdb, *handle);
+
+	return (res);
 }
 
 cs_error_t
diff --git a/lib/cpg.c b/lib/cpg.c
index 780e79f..79836e4 100644
--- a/lib/cpg.c
+++ b/lib/cpg.c
@@ -164,6 +164,9 @@ cs_error_t cpg_finalize (
 	cpg_handle_t handle)
 {
 	struct cpg_inst *cpg_inst;
+	struct iovec iov;
+	struct req_lib_cpg_finalize req_lib_cpg_finalize;
+	struct res_lib_cpg_finalize res_lib_cpg_finalize;
 	cs_error_t error;
 
 	error = hdb_error_to_cs (hdb_handle_get (&cpg_handle_t_db, handle, (void *)&cpg_inst));
@@ -181,12 +184,36 @@ cs_error_t cpg_finalize (
 
 	cpg_inst->finalize = 1;
 
+	/*
+	 * Send service request
+	 */
+	req_lib_cpg_finalize.header.size = sizeof (struct req_lib_cpg_finalize);
+	req_lib_cpg_finalize.header.id = MESSAGE_REQ_CPG_FINALIZE;
+
+	iov.iov_base = (void *)&req_lib_cpg_finalize;
+	iov.iov_len = sizeof (struct req_lib_cpg_finalize);
+
+	error = coroipcc_msg_send_reply_receive (cpg_inst->handle,
+		&iov,
+		1,
+		&res_lib_cpg_finalize,
+		sizeof (struct req_lib_cpg_finalize));
+
+	if (error != CS_OK) {
+		goto error_put;
+	}
+
 	coroipcc_service_disconnect (cpg_inst->handle);
 
 	cpg_inst_finalize (cpg_inst, handle);
 	hdb_handle_put (&cpg_handle_t_db, handle);
 
 	return (CPG_OK);
+
+error_put:
+	hdb_handle_put (&cpg_iteration_handle_t_db, handle);
+	cpg_inst->finalize = 0;
+	return (error);
 }
 
 cs_error_t cpg_fd_get (
diff --git a/lib/sa-confdb.c b/lib/sa-confdb.c
index 712df9d..0a71115 100644
--- a/lib/sa-confdb.c
+++ b/lib/sa-confdb.c
@@ -97,6 +97,7 @@ static int load_config(void)
 	void *config_p;
 	struct config_iface_ver0 *config;
 	const char *error_string;
+	char *strtok_savept;
 
 	/* User's bootstrap config service */
 	config_iface = getenv("COROSYNC_DEFAULT_CONFIG_IFACE");
@@ -111,7 +112,7 @@ static int load_config(void)
 		return -1;
 	}
 
-	iface = strtok(config_iface, ":");
+	iface = strtok_r (config_iface, ":", &strtok_savept);
 	while (iface)
 	{
 		res = lcr_ifact_reference (
@@ -133,7 +134,7 @@ static int load_config(void)
 
 		config_modules[num_config_modules++] = config;
 
-		iface = strtok(NULL, ":");
+		iface = strtok_r (NULL, ":", &strtok_savept);
 	}
 	free(config_iface);
 
diff --git a/man/corosync.conf.5 b/man/corosync.conf.5
index 6abe5c4..6ab94f7 100644
--- a/man/corosync.conf.5
+++ b/man/corosync.conf.5
@@ -41,11 +41,9 @@ corosync.conf - corosync executive configuration file
 
 .SH DESCRIPTION
 The corosync.conf instructs the corosync executive about various parameters
-needed to control the corosync executive.  The configuration file consists of
-bracketed top level directives.  The possible directive choices are
-.IR "totem  { } , logging { }.  It is also possible to specify the top level
-parameter compatibility.
- These directives are described below.
+needed to control the corosync executive.  Empty lines and lines starting with
+# character are ignored.  The configuration file consists of bracketed top level
+directives.  The possible directive choices are:
 
 .TP
 totem { }
@@ -59,12 +57,12 @@ This top level directive contains configuration options for the event service.
 
 .PP
 .PP
-The
-.B compatibility
-directive indicates the level of compatibility requested by the user.  The
+It is also possible to specify the top level parameter
+.B compatibility.
+This directive indicates the level of compatibility requested by the user.  The
 option whitetank can be specified to remain backward compatable with
 openais-0.80.z.  The option none can be specified to only be compatable
-with corsoync-1.Y.Z.  Extra processing during configuration changes is
+with corosync-1.Y.Z.  Extra processing during configuration changes is
 required to remain backward compatable.
 
 The default is whitetank. (backwards compatibility)
@@ -86,7 +84,7 @@ ringnumber
 This specifies the ring number for the interface.  When using the redundant
 ring protocol, each interface should specify separate ring numbers to uniquely
 identify to the membership protocol which interface to use for which redundant
-ring.
+ring. The ringnumber must start at 0.
 
 .TP
 bindnetaddr
@@ -490,6 +488,31 @@ and
 
 The default is syslog and stderr.
 
+Please note, if you are using to_logfile and want to rotate the file, use logrotate(8)
+with the option 
+.B
+copytruncate.
+eg.
+.IP
+.RS
+.ne 18
+.nf
+.ta 4n 30n 33n
+/var/log/corosync.log {
+	missingok
+	compress
+	notifempty
+	daily
+	rotate 7
+	copytruncate
+}
+.ta
+.fi
+.RE
+.IP
+.PP
+
+
 .TP
 logfile
 If the
@@ -564,5 +587,6 @@ required.
 The corosync executive configuration file.
 
 .SH "SEE ALSO"
-.BR corosync_overview (8)
+.BR corosync_overview (8),
+.BR logrotate (8)
 .PP
diff --git a/services/Makefile.am b/services/Makefile.am
index f3a9f78..06365db 100644
--- a/services/Makefile.am
+++ b/services/Makefile.am
@@ -80,7 +80,7 @@ endif
 	$(CC) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o $@ $<
 
 lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+	-splint $(INCLUDES) $(LINT_FLAGS) $(CFLAGS) *.c
 
 all-local: $(LCRSO_OBJS) $(LCRSO)
 	@echo Built Service Engines
diff --git a/services/Makefile.in b/services/Makefile.in
index fd31582..ef49fd2 100644
--- a/services/Makefile.in
+++ b/services/Makefile.in
@@ -413,7 +413,7 @@ uninstall-am: uninstall-local
 	$(CC) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o $@ $<
 
 lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+	-splint $(INCLUDES) $(LINT_FLAGS) $(CFLAGS) *.c
 
 all-local: $(LCRSO_OBJS) $(LCRSO)
 	@echo Built Service Engines
diff --git a/services/cfg.c b/services/cfg.c
index 6c7eff1..08028f2 100644
--- a/services/cfg.c
+++ b/services/cfg.c
@@ -547,10 +547,7 @@ int cfg_lib_exit_fn (void *conn)
 	struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn);
 
 	ENTER();
-	if (!list_empty(&ci->list)) {
-		list_del(&ci->list);
-		remove_ci_from_shutdown(ci);
-	}
+	remove_ci_from_shutdown(ci);
 	LEAVE();
 	return (0);
 }
diff --git a/services/cpg.c b/services/cpg.c
index 59d59b2..ede426f 100644
--- a/services/cpg.c
+++ b/services/cpg.c
@@ -214,6 +214,8 @@ static void message_handler_req_lib_cpg_join (void *conn, const void *message);
 
 static void message_handler_req_lib_cpg_leave (void *conn, const void *message);
 
+static void message_handler_req_lib_cpg_finalize (void *conn, const void *message);
+
 static void message_handler_req_lib_cpg_mcast (void *conn, const void *message);
 
 static void message_handler_req_lib_cpg_membership (void *conn,
@@ -240,7 +242,9 @@ static int cpg_exec_send_downlist(void);
 
 static int cpg_exec_send_joinlist(void);
 
-static void cpg_sync_init (
+static void cpg_sync_init_v2 (
+	const unsigned int *trans_list,
+	size_t trans_list_entries,
 	const unsigned int *member_list,
 	size_t member_list_entries,
 	const struct memb_ring_id *ring_id);
@@ -288,6 +292,10 @@ static struct corosync_lib_handler cpg_lib_engine[] =
 		.lib_handler_fn				= message_handler_req_lib_cpg_iteration_finalize,
 		.flow_control				= CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 	},
+	{ /* 8 */
+		.lib_handler_fn				= message_handler_req_lib_cpg_finalize,
+		.flow_control				= CS_LIB_FLOW_CONTROL_REQUIRED
+	},
 };
 
 static struct corosync_exec_handler cpg_exec_engine[] =
@@ -329,8 +337,8 @@ struct corosync_service_engine cpg_service_engine = {
 	.exec_dump_fn				= NULL,
 	.exec_engine				= cpg_exec_engine,
 	.exec_engine_count		        = sizeof (cpg_exec_engine) / sizeof (struct corosync_exec_handler),
-	.sync_mode				= CS_SYNC_V1,
-	.sync_init                              = cpg_sync_init,
+	.sync_mode				= CS_SYNC_V1_APIV2,
+	.sync_init                              = (sync_init_v1_fn_t)cpg_sync_init_v2,
 	.sync_process                           = cpg_sync_process,
 	.sync_activate                          = cpg_sync_activate,
 	.sync_abort                             = cpg_sync_abort
@@ -406,7 +414,9 @@ struct req_exec_cpg_downlist {
 
 static struct req_exec_cpg_downlist g_req_exec_cpg_downlist;
 
-static void cpg_sync_init (
+static void cpg_sync_init_v2 (
+	const unsigned int *trans_list,
+	size_t trans_list_entries,
 	const unsigned int *member_list,
 	size_t member_list_entries,
 	const struct memb_ring_id *ring_id)
@@ -435,8 +445,8 @@ static void cpg_sync_init (
 		 */
 		for (i = 0; i < my_old_member_list_entries; i++) {
 			found = 0;
-			for (j = 0; j < my_member_list_entries; j++) {
-				if (my_old_member_list[i] == my_member_list[j]) {
+			for (j = 0; j < trans_list_entries; j++) {
+				if (my_old_member_list[i] == trans_list[j]) {
 					found = 1;
 					break;
 				}
@@ -1063,6 +1073,21 @@ static void message_handler_req_lib_cpg_join (void *conn, const void *message)
 		}
 	}
 
+	/*
+	 * Same check must be done in process info list, because there may be not yet delivered
+	 * leave of client.
+	 */
+	for (iter = process_info_list_head.next; iter != &process_info_list_head; iter = iter->next) {
+		struct process_info *pi = list_entry (iter, struct process_info, list);
+
+		if (pi->nodeid == api->totem_nodeid_get () && pi->pid == req_lib_cpg_join->pid &&
+		    mar_name_compare(&req_lib_cpg_join->group_name, &pi->group) == 0) {
+			/* We have same pid and group name joined -> return error */
+			error = CPG_ERR_TRY_AGAIN;
+			goto response_send;
+		}
+	}
+
 	switch (cpd->cpd_state) {
 	case CPD_STATE_UNJOINED:
 		error = CPG_OK;
@@ -1130,6 +1155,32 @@ static void message_handler_req_lib_cpg_leave (void *conn, const void *message)
 	api->ipc_response_send(conn, &res_lib_cpg_leave, sizeof(res_lib_cpg_leave));
 }
 
+/* Finalize message from library */
+static void message_handler_req_lib_cpg_finalize (
+	void *conn,
+	const void *message)
+{
+	struct cpg_pd *cpd = (struct cpg_pd *)api->ipc_private_data_get (conn);
+	struct res_lib_cpg_finalize res_lib_cpg_finalize;
+	cs_error_t error = CS_OK;
+
+	log_printf (LOGSYS_LEVEL_DEBUG, "cpg finalize for conn=%p\n", conn);
+
+	/*
+	 * We will just remove cpd from list. After this call, connection will be
+	 * closed on lib side, and cpg_lib_exit_fn will be called
+	 */
+	list_del (&cpd->list);
+	list_init (&cpd->list);
+
+	res_lib_cpg_finalize.header.size = sizeof (res_lib_cpg_finalize);
+	res_lib_cpg_finalize.header.id = MESSAGE_RES_CPG_FINALIZE;
+	res_lib_cpg_finalize.header.error = error;
+
+	api->ipc_response_send (conn, &res_lib_cpg_finalize,
+		sizeof (res_lib_cpg_finalize));
+}
+
 /* Mcast message from the library */
 static void message_handler_req_lib_cpg_mcast (void *conn, const void *message)
 {
diff --git a/test/Makefile.am b/test/Makefile.am
index 2a88908..d87ceef 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -31,7 +31,7 @@
 # THE POSSIBILITY OF SUCH DAMAGE.
 
 MAINTAINERCLEANFILES    = Makefile.in
-INCLUDES       		= -I$(top_builddir)/include -I$(top_srcdir)/include
+INCLUDES       		= -I$(top_builddir)/include/corosync -I$(top_srcdir)/include
 
 noinst_PROGRAMS		= testevs evsbench evsverify cpgverify testcpg testcpg2 cpgbench testconfdb	\
 			logsysbench logsysrec testquorum testvotequorum1 testvotequorum2	\
@@ -88,8 +88,13 @@ logsys_t2_LDFLAGS	= -L../exec
 testsam_LDADD		= -lsam
 testsam_LDFLAGS		= -L../lib
 
+LINT_FILES1:=$(filter-out sa_error.c, $(wildcard *.c))
+LINT_FILES2:=$(filter-out testevsth.c, $(LINT_FILES1))
+LINT_FILES:=$(filter-out testparse.c, $(LINT_FILES2))
+
+
 lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+	-for f in $(LINT_FILES) ; do echo Splint $$f ; splint $(INCLUDES) $(LINT_FLAGS) $(CFLAGS) $$f ; done
 
 clean-local:
 	rm -f fdata
diff --git a/test/Makefile.in b/test/Makefile.in
index 027a80b..c0e93d2 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -353,7 +353,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
+INCLUDES = -I$(top_builddir)/include/corosync -I$(top_srcdir)/include
 testevs_LDADD = -levs -lcoroipcc
 testevs_LDFLAGS = -L../lib
 testcpg_LDADD = -lcpg -lcoroipcc
@@ -403,6 +403,9 @@ logsys_t2_LDADD = -llogsys
 logsys_t2_LDFLAGS = -L../exec
 testsam_LDADD = -lsam
 testsam_LDFLAGS = -L../lib
+LINT_FILES1 := $(filter-out sa_error.c, $(wildcard *.c))
+LINT_FILES2 := $(filter-out testevsth.c, $(LINT_FILES1))
+LINT_FILES := $(filter-out testparse.c, $(LINT_FILES2))
 all: all-am
 
 .SUFFIXES:
@@ -759,7 +762,7 @@ uninstall-am:
 
 
 lint:
-	-splint $(LINT_FLAGS) $(CFLAGS) *.c
+	-for f in $(LINT_FILES) ; do echo Splint $$f ; splint $(INCLUDES) $(LINT_FLAGS) $(CFLAGS) $$f ; done
 
 clean-local:
 	rm -f fdata
diff --git a/test/testcpg.c b/test/testcpg.c
index c9fe79d..2abe83d 100644
--- a/test/testcpg.c
+++ b/test/testcpg.c
@@ -163,7 +163,7 @@ int main (int argc, char *argv[]) {
 
 	if (argc > optind) {
 		strcpy(group_name.value, argv[optind]);
-		group_name.length = strlen(argv[optind])+1;
+		group_name.length = strlen(argv[optind]);
 	}
 	else {
 		strcpy(group_name.value, "GROUP");
diff --git a/tools/corosync-keygen.c b/tools/corosync-keygen.c
index 96966a6..c842fd1 100644
--- a/tools/corosync-keygen.c
+++ b/tools/corosync-keygen.c
@@ -86,7 +86,7 @@ retry_read:
 	}
 	bytes_read += res;
 	if (bytes_read != sizeof (key)) {
-		printf ("Press keys on your keyboard to generate entropy (bits = %d).\n", bytes_read * 8);
+		printf ("Press keys on your keyboard to generate entropy (bits = %d).\n", (int)(bytes_read * 8));
 		goto retry_read;
 	}
 	close (random_fd);
diff --git a/tools/corosync-objctl.c b/tools/corosync-objctl.c
index 8e2d754..693c312 100644
--- a/tools/corosync-objctl.c
+++ b/tools/corosync-objctl.c
@@ -123,11 +123,11 @@ static void print_key (char *key_name, void *value, size_t value_len, confdb_val
 					  *(uint32_t*)value);
 			break;
 		case CONFDB_VALUETYPE_INT64:
-			printf ("%s=%lld\n", key_name,
+			printf ("%s=%"PRIi64"\n", key_name,
 					  *(int64_t*)value);
 			break;
 		case CONFDB_VALUETYPE_UINT64:
-			printf ("%s=%llu\n", key_name,
+			printf ("%s=%"PRIu64"\n", key_name,
 					  *(uint64_t*)value);
 			break;
 		case CONFDB_VALUETYPE_STRING:

-- 
corosync Debian packaging



More information about the Debian-ha-svn-commits mailing list