mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 05:13:58 -07:00
send_cmd() retrun value bugfix + minor debug changes
This commit is contained in:
parent
f558b088e6
commit
a421e31dd5
4 changed files with 12 additions and 11 deletions
|
@ -138,7 +138,7 @@ static void checkpid()
|
|||
return;
|
||||
|
||||
if (thispid != getpid()) {
|
||||
printf("clone/fork detected. re-initializing this instance.\n");
|
||||
dwr(MSG_DEBUG, "checkpid(): clone/fork detected. Re-initializing this instance.\n");
|
||||
set_up_intercept();
|
||||
fdret_sock = init_service_connection();
|
||||
thispid = getpid();
|
||||
|
@ -216,12 +216,11 @@ static int send_cmd(int rpc_fd, char *cmd)
|
|||
#endif
|
||||
/* Combine command flag+payload with RPC metadata */
|
||||
memcpy(&metabuf[IDX_PAYLOAD], cmd, PAYLOAD_SZ);
|
||||
usleep(1000);
|
||||
usleep(100000);
|
||||
int n_write = write(rpc_fd, &metabuf, BUF_SZ);
|
||||
if(n_write < 0){
|
||||
dwr(MSG_DEBUG,"Error writing command to service (CMD = %d)\n", cmd[0]);
|
||||
errno = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ret = ERR_OK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue