summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Mikhailov <mvp@users.noreply.github.com>2022-09-22 11:09:24 -0700
committerVadim Mikhailov <mvp@users.noreply.github.com>2022-09-22 11:09:24 -0700
commitdd5ff8f79d1e60ada2a81bb4edc36dfacaa4244a (patch)
treef1f6b729bd118726ff5f3ebb0681404b46e46d95
parenta802fa75aa11e322caa768391af64559642345b2 (diff)
Fix unused variable compilation warning on non Linux platforms
-rw-r--r--uhubctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/uhubctl.c b/uhubctl.c
index 9c99ebe..7bc1532 100644
--- a/uhubctl.c
+++ b/uhubctl.c
@@ -546,8 +546,8 @@ static int set_port_status_linux(struct libusb_device_handle *devh, struct hub_i
int disable_fd = open(disable_path, O_WRONLY);
if (disable_fd >= 0) {
- rc = write(disable_fd, on ? "0" : "1", 1);
- close(disable_fd);
+ rc = write(disable_fd, on ? "0" : "1", 1);
+ close(disable_fd);
}
if (disable_fd < 0 || rc < 0) {
@@ -616,6 +616,8 @@ static int set_port_status(struct libusb_device_handle *devh, struct hub_info *h
return 0;
}
}
+#else
+ (void)hub;
#endif
return set_port_status_libusb(devh, port, on);