فهرست منبع

main: let poll really stop before totempg_finalize

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
(cherry picked from commit d4fb83e971b6fa9af0447ce0a70345fb20064dc1)
Jan Friesse 14 سال پیش
والد
کامیت
b620cd7d56
1فایلهای تغییر یافته به همراه15 افزوده شده و 9 حذف شده
  1. 15 9
      exec/main.c

+ 15 - 9
exec/main.c

@@ -147,6 +147,8 @@ static int32_t corosync_not_enough_fds_left = 0;
 
 static void serialize_unlock (void);
 
+static void serialize_lock (void);
+
 hdb_handle_t corosync_poll_handle_get (void)
 {
 	return (corosync_poll_handle);
@@ -174,14 +176,7 @@ static void unlink_all_completed (void)
 	serialize_unlock ();
 	api->timer_delete (corosync_stats_timer_handle);
 	poll_stop (corosync_poll_handle);
-	totempg_finalize ();
-
-	/*
-	 * Remove pid lock file
-	 */
-	unlink (corosync_lock_file);
-
-	corosync_exit_error (AIS_DONE_EXIT);
+	serialize_lock ();
 }
 
 void corosync_shutdown_request (void)
@@ -1802,6 +1797,17 @@ int main (int argc, char **argv, char **envp)
 	 */
 	poll_run (corosync_poll_handle);
 
+	/*
+	 * Exit was requested
+	 */
+	totempg_finalize ();
+
+	/*
+	 * Remove pid lock file
+	 */
+	unlink (corosync_lock_file);
+
+	corosync_exit_error (AIS_DONE_EXIT);
+
 	return EXIT_SUCCESS;
 }
-