mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
pm-graph: make setVal unbuffered again for python2 and python3
sleepgraph: - kprobe_events won't set correctly if the data is buffered - force sysvals.setVal to be unbuffered and use binary mode - tested in both python2 and python3 Link: https://bugzilla.kernel.org/show_bug.cgi?id=204773 Signed-off-by: Todd Brandt <[email protected]> [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
1446794a89
commit
4216148337
1 changed files with 5 additions and 5 deletions
|
|
@ -667,19 +667,19 @@ class SystemValues:
|
|||
if linesack < linesout:
|
||||
return False
|
||||
return True
|
||||
def setVal(self, val, file, mode='w'):
|
||||
def setVal(self, val, file):
|
||||
if not os.path.exists(file):
|
||||
return False
|
||||
try:
|
||||
fp = open(file, mode)
|
||||
fp.write(val)
|
||||
fp = open(file, 'wb', 0)
|
||||
fp.write(val.encode())
|
||||
fp.flush()
|
||||
fp.close()
|
||||
except:
|
||||
return False
|
||||
return True
|
||||
def fsetVal(self, val, path, mode='w'):
|
||||
return self.setVal(val, self.tpath+path, mode)
|
||||
def fsetVal(self, val, path):
|
||||
return self.setVal(val, self.tpath+path)
|
||||
def getVal(self, file):
|
||||
res = ''
|
||||
if not os.path.exists(file):
|
||||
|
|
|
|||
Loading…
Reference in a new issue