-
-// *reply = (char *) malloc(MSG_MAX+1);
-// result = recv(fd, *reply, MSG_MAX, 0);
-// if(result == -1) {
-// PERROR("recv");
-// return -1;
-// }
-// else if(result == 0) {
-// return 0;
-// }
-//
-// (*reply)[result] = '\0';
-//
-// return 1;
-}
-
-static int send_message_path(const char *path, const char *msg, int signalpid)
-{
- int fd;
- int result;
- struct sockaddr_un addr;
-
- result = fd = socket(PF_UNIX, SOCK_STREAM, 0);
- if(result == -1) {
- PERROR("socket");
- return -1;
- }
-
- addr.sun_family = AF_UNIX;
-
- result = snprintf(addr.sun_path, UNIX_PATH_MAX, "%s", path);
- if(result >= UNIX_PATH_MAX) {
- ERR("string overflow allocating socket name");
- return -1;
- }
-
- if(signalpid >= 0)
- signal_process(signalpid);
-
- result = connect(fd, (struct sockaddr *)&addr, sizeof(addr));
- if(result == -1) {
- PERROR("connect");
- return -1;
- }
-
- return send_message_fd(fd, msg);