Replace usage of os.mknod() by os.open(O_CREAT)

Haiku doesn't have mknod().
Actually it does now, but it might take ages for python
to support it as os.mknod().
This commit is contained in:
François Revol 2014-07-28 23:05:21 +02:00 committed by Romain Bignon
commit ecd265de4f

View file

@ -52,7 +52,8 @@ class BackendsConfig(object):
fptr.close()
else:
try:
os.mknod(confpath, 0o600)
fd = os.open(confpath, os.O_WRONLY | os.O_CREAT, 0o600)
os.close(fd)
except OSError:
fptr = open(confpath, 'w')
fptr.close()