diff options
author | infirit <[email protected]> | 2014-10-24 16:41:39 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2014-10-24 16:41:39 +0200 |
commit | eac511111f4e818d1002a64c3c94c33e90d860c9 (patch) | |
tree | c829104e883bd854a021c9e6e55d1ef0a0b986dc /src/core | |
parent | 49e91bc9093010e269816da1df763a0374dbc515 (diff) | |
download | marco-eac511111f4e818d1002a64c3c94c33e90d860c9.tar.bz2 marco-eac511111f4e818d1002a64c3c94c33e90d860c9.tar.xz |
Add error handling to glibtop_get_proc_uid
Author: Tomaž Šolc
Based on commit: 4ecd6e49164ee027cee8dfdbb51fd8389694ff43
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=603240
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/window-props.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/window-props.c b/src/core/window-props.c index 9aab46ea..8eff8d8a 100644 --- a/src/core/window-props.c +++ b/src/core/window-props.c @@ -399,8 +399,15 @@ owner_of_process (pid_t process, uid_t *result) glibtop_get_proc_uid (&process_details, process); - *result = process_details.uid; - return TRUE; + if (process_details.flags & (1L << GLIBTOP_PROC_UID_UID)) + { + *result = process_details.uid; + return TRUE; + } + else + { + return FALSE; + } #else /* I don't know, maybe we could do something hairy like see whether * /proc/$PID exists and who owns it, in case they have procfs. |