}
int chars = snprintf(path, sizeof(path), "%016llx\n%d\n", key, port);
- write(fd, path, chars);
+ ssize_t r = write(fd, path, chars);
+ (void)r;
close(fd);
return 0;
return -1;
}
+ // Reset the timeout, as the command execution may take arbitrary long time
+ struct timeval tv0 = {0, 0};
+ setsockopt(client, SOL_SOCKET, SO_RCVTIMEO, &tv0, sizeof(tv0));
+
return client;
}