Skip to content

Commit 029f7f2

Browse files
macos doesn't support ioctl SIOCGSTAMP
1 parent 6511bc3 commit 029f7f2

File tree

1 file changed

+4
-1
lines changed
  • can/interfaces/udp_multicast

1 file changed

+4
-1
lines changed

can/interfaces/udp_multicast/bus.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import struct
66
import time
77
import warnings
8+
import platform
89
from typing import List, Optional, Tuple, Union
910

1011
import can
@@ -21,6 +22,8 @@
2122
ioctl_supported = False
2223
pass
2324

25+
# All ioctls aren't supported on MacOS.
26+
is_macos = platform.system() == "Darwin"
2427

2528
log = logging.getLogger(__name__)
2629

@@ -402,7 +405,7 @@ def recv(
402405
self.max_buffer
403406
)
404407

405-
if ioctl_supported:
408+
if ioctl_supported and not is_macos:
406409
result_buffer = ioctl(
407410
self._socket.fileno(),
408411
SIOCGSTAMP,

0 commit comments

Comments
 (0)