Apparently OS X is throwing EPERM for mknod(... SOCK_STREAM), and the
current OS X manpage does state that mknod() requires superuser
privileges.
Thanks to Zoran Zaric <zz@zoranzaric.de> for the report.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
try:
os.mknod(path, 0600 | stat.S_IFSOCK)
except OSError, e:
- if e.errno == errno.EINVAL:
+ if e.errno in (errno.EINVAL, errno.EPERM):
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.bind(path)
else: