IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Преглед на файлове

Added code to figure out MNAMELEN dynamically as it can apparently change between FreeBSD releases.

master
Stanislaw Adaszewski преди 4 години
родител
ревизия
821d8706f5
променени са 1 файла, в които са добавени 14 реда и са изтрити 1 реда
  1. +14
    -1
      focker/mount.py

+ 14
- 1
focker/mount.py Целия файл

@@ -16,10 +16,23 @@ from ctypes import Structure, \
ARRAY, \ ARRAY, \
byref byref
from ctypes.util import find_library from ctypes.util import find_library
import re
with open('/usr/include/sys/mount.h', 'r') as f:
rx = re.compile('[ \t]')
lines = f.read().split('\n')
lines = [ a.strip() for a in lines \
if list(filter(lambda b: b, rx.split(a))) [:2] == \
[ '#define', 'MNAMELEN'] ]
MNAMELEN = int(rx.split(lines[0])[2])
# print('MNAMELEN:', MNAMELEN)
#line = list(filter(lambda a: \
# list(filter(lambda b: b, rx.split(a), a)[:2]) == \
# ['#define', 'MNAMELEN'], f.read().split('\n')))
#line[0]
MFSNAMELEN = 16 MFSNAMELEN = 16
MNAMELEN = 1024
# MNAMELEN = 1024
class statfs(Structure): class statfs(Structure):


Loading…
Отказ
Запис