When nbd-client is compiled on a system that does not support the timeout
ioctl(), we now fail with an error message. Previously, the option would be
silently ignored, which might not be optimal.
}
void set_timeout(int nbd, int timeout) {
}
void set_timeout(int nbd, int timeout) {
if (ioctl(nbd, NBD_SET_TIMEOUT, (unsigned long)timeout) < 0)
err("Ioctl NBD_SET_TIMEOUT failed: %m\n");
fprintf(stderr, "timeout=%d\n", timeout);
if (ioctl(nbd, NBD_SET_TIMEOUT, (unsigned long)timeout) < 0)
err("Ioctl NBD_SET_TIMEOUT failed: %m\n");
fprintf(stderr, "timeout=%d\n", timeout);
+#else
+ err("Ioctl NBD_SET_TIMEOUT cannot be called when compiled on a system that does not support it\n");
}
void finish_sock(int sock, int nbd, int swap) {
}
void finish_sock(int sock, int nbd, int swap) {