daemon: Minor code reorganization.
This commit is contained in:
parent
0dcf2c05f0
commit
104d05a4be
2 changed files with 9 additions and 8 deletions
|
@ -12,6 +12,11 @@ procedures.
|
|||
'''
|
||||
|
||||
import subprocess, os, ast
|
||||
import fcntl
|
||||
|
||||
def closeonexec(fd):
|
||||
fdflags = fcntl.fcntl(fd, fcntl.F_GETFD)
|
||||
fcntl.fcntl(fd, fcntl.F_SETFD, fdflags | fcntl.FD_CLOEXEC)
|
||||
|
||||
def checkexec(execlist):
|
||||
for bin in execlist:
|
||||
|
@ -265,6 +270,6 @@ def checkforkernelmodule(name):
|
|||
'''
|
||||
with open('/proc/modules', 'r') as f:
|
||||
for line in f:
|
||||
if line[:len(name)] == name:
|
||||
return line
|
||||
if line.startswith(name + ' '):
|
||||
return line.rstrip()
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue