projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1986025
)
[utils] Simplify setproctitle
author
Philipp Hagemeister
<phihag@phihag.de>
Sun, 23 Mar 2014 13:28:22 +0000
(14:28 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Sun, 23 Mar 2014 13:28:22 +0000
(14:28 +0100)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 3574fc615c6eb54228c9b07c47ff0499b72333b7..8b359cb77f9188baa9c0a1fcea322268992bd90d 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-1126,11
+1126,11
@@
def setproctitle(title):
libc = ctypes.cdll.LoadLibrary("libc.so.6")
except OSError:
return
- title
= title
- buf = ctypes.create_string_buffer(len(title
) + 1
)
- buf.value = title
.encode('utf-8')
+ title
_bytes = title.encode('utf-8')
+ buf = ctypes.create_string_buffer(len(title
_bytes)
)
+ buf.value = title
_bytes
try:
- libc.prctl(15,
ctypes.byref(buf)
, 0, 0, 0)
+ libc.prctl(15,
buf
, 0, 0, 0)
except AttributeError:
return # Strange libc, just skip this