Commit 50385761 authored by Bastien Nocera's avatar Bastien Nocera Committed by David Zeuthen

Fix process start time when using polkit_unix_process_new_full()

When using polkit_unix_process_new_full() the start-time
wasn't being set from the process' PID if it wasn't
passed to the function.
Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent bce2c389
......@@ -157,7 +157,7 @@ polkit_unix_process_class_init (PolkitUnixProcessClass *klass)
g_param_spec_int ("pid",
"Process ID",
"The UNIX process ID",
0,
-1,
G_MAXINT,
0,
G_PARAM_CONSTRUCT |
......@@ -323,7 +323,10 @@ polkit_unix_process_new_full (gint pid,
process = POLKIT_UNIX_PROCESS (polkit_unix_process_new ((gint) -1));
process->pid = pid;
process->start_time = start_time;
if (start_time != 0)
process->start_time = start_time;
else
process->start_time = get_start_time_for_pid (pid, NULL);
return POLKIT_SUBJECT (process);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment