changed client sockets to use PID instead of random 32bit number.

Means that bindings can be reused more easily, and directory doesn't
fill up with stale sockets so easily.
This commit is contained in:
gardners 2012-04-30 15:34:54 +09:30
parent e38854d4c0
commit 900bfab1e9

View File

@ -1121,10 +1121,10 @@ int overlay_mdp_client_init()
name.sun_family = AF_UNIX;
if (overlay_mdp_client_socket_path_len==-1) {
char fmt[1024];
if (!FORM_SERVAL_INSTANCE_PATH(fmt, "mdp-client-%08x.socket"))
if (!FORM_SERVAL_INSTANCE_PATH(fmt, "mdp-client-%d.socket"))
return WHY("Could not form MDP client socket name");
snprintf(overlay_mdp_client_socket_path,1024,fmt,random_value);
overlay_mdp_client_socket_path_len=strlen(overlay_mdp_client_socket_path);
snprintf(overlay_mdp_client_socket_path,1024,fmt,getpid());
overlay_mdp_client_socket_path_len=strlen(overlay_mdp_client_socket_path)+1;
WHYF("MDP client socket name='%s'",overlay_mdp_client_socket_path);
}
bcopy(overlay_mdp_client_socket_path,name.sun_path,