chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
treewide: use stdio_unset_cloexec() function
[elogind.git]
/
src
/
basic
/
process-util.c
diff --git
a/src/basic/process-util.c
b/src/basic/process-util.c
index dd77df2ab10c196327819d5a02efe9c7986c8351..c9115f85eff0630940c4ed167c333d0e7c58c6ed 100644
(file)
--- a/
src/basic/process-util.c
+++ b/
src/basic/process-util.c
@@
-160,6
+160,8
@@
int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
if (len > 0)
r[len] = 0;
+ else
+ r = mfree(r);
} else {
bool dotdotdot = false;
@@
-213,7
+215,7
@@
int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
}
strncpy(k, "...", left-1);
- k[left] = 0;
+ k[left
-1
] = 0;
} else
*k = 0;
}
@@
-556,7
+558,7
@@
int wait_for_terminate(pid_t pid, siginfo_t *status) {
if (errno == EINTR)
continue;
- return
-errno
;
+ return
negative_errno()
;
}
return 0;