Просмотр исходного кода

The IPC system smply concatenates SOCKETDIR with run/<socketname> so if
th euser forgets to add a trailing slash to the name: eg

./configure --with-socket-dir=/var/run

then the socket is created as /var/runcorosync.ipc

This patch adds the slash into the name generation printf.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1910 fd59a12c-fef9-0310-b244-a6a79926bd2f

Christine Caulfield 17 лет назад
Родитель
Сommit
73a3bd206f
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      exec/coroipcs.c
  2. 1 1
      lib/coroipcc.c

+ 1 - 1
exec/coroipcs.c

@@ -531,7 +531,7 @@ extern void coroipcs_ipc_init (
 #if defined(COROSYNC_LINUX)
 	sprintf (un_addr.sun_path + 1, "%s", api->socket_name);
 #else
-	sprintf (un_addr.sun_path, "%s%s", SOCKETDIR, api->socket_name);
+	sprintf (un_addr.sun_path, "%s/%s", SOCKETDIR, api->socket_name);
 	unlink (un_addr.sun_path);
 #endif
 

+ 1 - 1
lib/coroipcc.c

@@ -304,7 +304,7 @@ coroipcc_service_connect (
 #if defined(COROSYNC_LINUX)
 	sprintf (address.sun_path + 1, "%s", socket_name);
 #else
-	sprintf (address.sun_path, "%s%s", SOCKETDIR, socket_name);
+	sprintf (address.sun_path, "%s/%s", SOCKETDIR, socket_name);
 #endif
 	res = connect (request_fd, (struct sockaddr *)&address,
 		AIS_SUN_LEN(&address));