OBS User unknown 2009-01-12 00:53:44 +00:00 committed by Git OBS Bridge
parent 72ac1b98d5
commit f4e058df28
3 changed files with 108 additions and 9 deletions

View File

@ -0,0 +1,87 @@
Index: src/procman.h
===================================================================
--- src/procman.h (revision 2544)
+++ src/procman.h (working copy)
@@ -96,12 +96,10 @@
struct MutableProcInfo
{
MutableProcInfo()
- : user(0),
- status(0)
+ : status(0)
{ }
- // shared, don't free it !
- const gchar* user;
+ std::string user;
gchar wchan[40];
@@ -132,7 +130,7 @@
/* undefined */ ProcInfo& operator=(const ProcInfo&);
/* undefined */ ProcInfo(const ProcInfo&);
- typedef std::map<guint, const char*> UserMap;
+ typedef std::map<guint, std::string> UserMap;
/* cached username */
static UserMap users;
Index: src/proctable.cpp
===================================================================
--- src/proctable.cpp (revision 2544)
+++ src/proctable.cpp (working copy)
@@ -24,6 +24,7 @@
#include <string.h>
#include <math.h>
#include <glib/gi18n.h>
+#include <glib/gprintf.h>
#include <glibtop.h>
#include <glibtop/loadavg.h>
#include <glibtop/proclist.h>
@@ -465,16 +466,16 @@
// procman_debug("User lookup for uid %u: %s", uid, (p.second ? "MISS" : "HIT"));
if (p.second) {
- char* username;
struct passwd* pwd;
pwd = getpwuid(uid);
if (pwd && pwd->pw_name)
- username = g_strdup(pwd->pw_name);
- else
- username = g_strdup_printf("%u", uid);
-
- p.first->second = username;
+ p.first->second = pwd->pw_name;
+ else {
+ char username[16];
+ g_sprintf(username, "%u", uid);
+ p.first->second = username;
+ }
}
this->user = p.first->second;
@@ -543,7 +544,7 @@
using procman::tree_store_update;
tree_store_update(model, &info->node, COL_STATUS, info->status);
- tree_store_update(model, &info->node, COL_USER, info->user);
+ tree_store_update(model, &info->node, COL_USER, info->user.c_str());
tree_store_update(model, &info->node, COL_VMSIZE, info->vmsize);
tree_store_update(model, &info->node, COL_MEMRES, info->memres);
tree_store_update(model, &info->node, COL_MEMWRITABLE, info->memwritable);
Index: src/util.cpp
===================================================================
--- src/util.cpp (revision 2544)
+++ src/util.cpp (working copy)
@@ -462,7 +462,9 @@
{
char* bytes = procman::format_size(rate, max_rate);
// xgettext: rate, 10MiB/s
- return make_string(g_strdup_printf(_("%s/s"), bytes));
+ std::string formatted_rate(make_string(g_strdup_printf(_("%s/s"), bytes)));
+ g_free(bytes);
+ return formatted_rate;
}
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 7 18:50:23 EST 2009 - hfiguiere@suse.de
- Add gnome-system-monitor-bgo566962-leaks.diff
* Fix memory leaks (bgo#566962)
-------------------------------------------------------------------
Tue Oct 21 19:52:17 EST 2008 - mboman@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package gnome-system-monitor (Version 2.24.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -44,12 +44,14 @@ BuildRequires: hal-devel hwinfo-devel
License: GPL v2 or later
Group: System/GUI/GNOME
Version: 2.24.1
Release: 1
Source0: ftp://ftp.gnome.org/pub/GNOME/sources/gnome-system-monitor/2.20/%{name}-%{version}.tar.bz2
Release: 2
Source0: ftp://ftp.gnome.org/pub/GNOME/sources/gnome-system-monitor/2.24/%{name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM bgo#566962 - hfiguiere@novell.com
Patch0: gnome-system-monitor-bgo566962-leaks.diff
# FATE 302198 - hfiguiere@novell.com
Patch0: gnome-system-monitor-fate302198.diff
Patch1: gnome-system-monitor-fate302198.diff
# FATE 304741 - hfiguiere@novell.com
Patch1: gnome-system-monitor-fate304741.diff
Patch2: gnome-system-monitor-fate304741.diff
Url: http://www.gnome.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: A Simple Process Monitor
@ -71,8 +73,9 @@ Authors:
%lang_package
%prep
%setup -q
%patch0
%patch1 -p1
%patch0 -p0
%patch1
%patch2 -p1
%build
autoreconf -si
@ -113,6 +116,9 @@ rm -rf $RPM_BUILD_ROOT
%files lang -f %{name}.lang
%changelog
* Wed Jan 07 2009 hfiguiere@suse.de
- Add gnome-system-monitor-bgo566962-leaks.diff
* Fix memory leaks (bgo#566962)
* Tue Oct 21 2008 mboman@suse.de
- Update to version 2.24.1:
+ Translation updates
@ -152,7 +158,7 @@ rm -rf $RPM_BUILD_ROOT
* graphs: fixed the time scale (#521394).
- Add gnome-system-monitor-performance.patch to Fix performance on
certain video cards (bnc #374934)
* Fri Mar 14 2008 maw@suse.de
* Thu Mar 13 2008 maw@suse.de
- Update to version 2.22.0:
+ Updated translations.
* Thu Mar 13 2008 sbrabec@suse.cz
@ -313,7 +319,7 @@ rm -rf $RPM_BUILD_ROOT
- Can use libsexy to display process arguments.
- New memory column : displays estimated memory usage.
- Fixed a couple of small leaks.
* Thu Jul 20 2006 jpr@suse.de
* Wed Jul 19 2006 jpr@suse.de
- Call aclocal to fix build after altering configure.in in %%prep
* Tue Jun 06 2006 jimmyk@suse.de
- Modify existing gnome-system-monitor-sysinfo.patch to properly parse