|
|
|
@ -167,9 +167,10 @@ int UnixNew(UnixCommand * this)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this->select_max = this->socket + 1;
|
|
|
|
this->select_max = this->socket + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !(defined OS_FREEBSD || defined __OpenBSD__)
|
|
|
|
/* Set file mode: will not fully work on most system, the group
|
|
|
|
/* Set file mode: will not fully work on most system, the group
|
|
|
|
* permission is not changed on some Linux and *BSD won't do the
|
|
|
|
* permission is not changed on some Linux. *BSD won't do the
|
|
|
|
* chmod. */
|
|
|
|
* chmod: it returns EINVAL when calling fchmod on sockets. */
|
|
|
|
ret = fchmod(this->socket, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
|
|
|
|
ret = fchmod(this->socket, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
|
|
|
|
if (ret == -1) {
|
|
|
|
if (ret == -1) {
|
|
|
|
int err = errno;
|
|
|
|
int err = errno;
|
|
|
|
@ -178,6 +179,7 @@ int UnixNew(UnixCommand * this)
|
|
|
|
strerror(err),
|
|
|
|
strerror(err),
|
|
|
|
err);
|
|
|
|
err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
/* set reuse option */
|
|
|
|
/* set reuse option */
|
|
|
|
ret = setsockopt(this->socket, SOL_SOCKET, SO_REUSEADDR,
|
|
|
|
ret = setsockopt(this->socket, SOL_SOCKET, SO_REUSEADDR,
|
|
|
|
(char *) &on, sizeof(on));
|
|
|
|
(char *) &on, sizeof(on));
|
|
|
|
|