chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c190efa
)
Allow NULL session parameter for manager_get_session_by_pid()
author
Sven Eden
<yamakuzure@gmx.net>
Thu, 16 Feb 2017 07:16:57 +0000
(08:16 +0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:23:13 +0000
(10:23 +0100)
The reason is, that method_create_session() calls that function to
detect whether there is already a running session.
src/login/logind-core.c
patch
|
blob
|
history
diff --git
a/src/login/logind-core.c
b/src/login/logind-core.c
index 277e26255b989e6e6a187d50096e89d97f729dc9..06ca3c1c8b38a88a36af21ddb238110fcabc77c8 100644
(file)
--- a/
src/login/logind-core.c
+++ b/
src/login/logind-core.c
@@
-284,7
+284,6
@@
int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session) {
int r;
assert(m);
- assert(session);
if (pid < 1)
return -EINVAL;
@@
-306,7
+305,8
@@
int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session) {
if (!s)
return 0;
- *session = s;
+ if (session)
+ *session = s;
return 1;
}