@@ -47,7 +47,7 @@ int snprintf(char * __restrict __str, size_t __size, const char * __restrict __f
47
47
#include <time.h> /* for nanosleep */
48
48
#endif
49
49
50
- #ifdef __gnu_linux__
50
+ #if defined( __gnu_linux__ ) || defined( __linux__ )
51
51
#include <fcntl.h> /* for open() / O_WRONLY */
52
52
#endif
53
53
@@ -227,14 +227,14 @@ static int opt_exact = 0; /* exact location match - disable USB3 duality handl
227
227
static int opt_reset = 0 ; /* reset hub after operation(s) */
228
228
static int opt_force = 0 ; /* force operation even on unsupported hubs */
229
229
static int opt_nodesc = 0 ; /* skip querying device description */
230
- #ifdef __gnu_linux__
230
+ #if defined( __gnu_linux__ ) || defined( __linux__ )
231
231
static int opt_nosysfs = 0 ; /* don't use the Linux sysfs port disable interface, even if available */
232
232
#endif
233
233
234
234
235
235
static const char short_options [] =
236
236
"l:L:n:a:p:d:r:w:s:hvefRN"
237
- #ifdef __gnu_linux__
237
+ #if defined( __gnu_linux__ ) || defined( __linux__ )
238
238
"S"
239
239
#endif
240
240
;
@@ -252,7 +252,7 @@ static const struct option long_options[] = {
252
252
{ "exact" , no_argument , NULL , 'e' },
253
253
{ "force" , no_argument , NULL , 'f' },
254
254
{ "nodesc" , no_argument , NULL , 'N' },
255
- #ifdef __gnu_linux__
255
+ #if defined( __gnu_linux__ ) || defined ( __linux__ )
256
256
{ "nosysfs" , no_argument , NULL , 'S' },
257
257
#endif
258
258
{ "reset" , no_argument , NULL , 'R' },
@@ -281,7 +281,7 @@ static int print_usage(void)
281
281
"--exact, -e - exact location (no USB3 duality handling).\n"
282
282
"--force, -f - force operation even on unsupported hubs.\n"
283
283
"--nodesc, -N - do not query device description (helpful for unresponsive devices).\n"
284
- #ifdef __gnu_linux__
284
+ #if defined( __gnu_linux__ ) || defined ( __linux__ )
285
285
"--nosysfs, -S - do not use the Linux sysfs port disable interface.\n"
286
286
#endif
287
287
"--reset, -R - reset hub after each power-on action, causing all devices to reassociate.\n"
@@ -555,7 +555,7 @@ static int get_port_status(struct libusb_device_handle *devh, int port)
555
555
}
556
556
557
557
558
- #ifdef __gnu_linux__
558
+ #if defined( __gnu_linux__ ) || defined( __linux__ )
559
559
/*
560
560
* Try to use the Linux sysfs interface to power a port off/on.
561
561
* Returns 0 on success.
@@ -655,7 +655,7 @@ static int set_port_status_libusb(struct libusb_device_handle *devh, int port, i
655
655
656
656
static int set_port_status (struct libusb_device_handle * devh , struct hub_info * hub , int port , int on )
657
657
{
658
- #ifdef __gnu_linux__
658
+ #if defined( __gnu_linux__ ) || defined( __linux__ )
659
659
if (!opt_nosysfs ) {
660
660
if (set_port_status_linux (devh , hub , port , on ) == 0 ) {
661
661
return 0 ;
@@ -1046,7 +1046,7 @@ static int usb_find_hubs(void)
1046
1046
}
1047
1047
}
1048
1048
if (perm_ok == 0 && hub_phys_count == 0 ) {
1049
- #ifdef __gnu_linux__
1049
+ #if defined( __gnu_linux__ ) || defined( __linux__ )
1050
1050
if (geteuid () != 0 ) {
1051
1051
fprintf (stderr ,
1052
1052
"There were permission problems while accessing USB.\n"
@@ -1129,7 +1129,7 @@ int main(int argc, char *argv[])
1129
1129
case 'N' :
1130
1130
opt_nodesc = 1 ;
1131
1131
break ;
1132
- #ifdef __gnu_linux__
1132
+ #if defined( __gnu_linux__ ) || defined( __linux__ )
1133
1133
case 'S' :
1134
1134
opt_nosysfs = 1 ;
1135
1135
break ;
0 commit comments