diff options
author | Bastien Nocera <hadess@hadess.net> | 2009-09-14 13:10:27 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2009-09-14 13:10:27 -0400 |
commit | 50385761decb0a5a79c6cdc975b427c5918d7de3 (patch) | |
tree | 9ccfa05947cb804503e495be12e5d4b64b1438c0 | |
parent | bce2c38942b5667f1019ef27b201531867edb2a1 (diff) | |
download | polkit-50385761decb0a5a79c6cdc975b427c5918d7de3.tar.gz |
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: David Zeuthen <davidz@redhat.com>
-rw-r--r-- | src/polkit/polkitunixprocess.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c index c690077..e132387 100644 --- a/src/polkit/polkitunixprocess.c +++ b/src/polkit/polkitunixprocess.c @@ -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); } |