From: Andrew Morton <akpm@digeo.com>
To: Edward Tandi <ed@efix.biz>
Cc: linux-kernel@vger.kernel.org, xosview-devel@lists.sourceforge.net
Subject: Re: 2.5.70 latest: breaks gnome
Date: Thu, 5 Jun 2003 16:11:32 -0700 [thread overview]
Message-ID: <20030605161132.46f793e2.akpm@digeo.com> (raw)
In-Reply-To: <1054852458.1886.18.camel@wires.home.biz>
Edward Tandi <ed@efix.biz> wrote:
>
> 2) xosview still freezes (reading /proc/*)
OK, here's a quick hack to get xosview-1.8.0 working on 2.5.x kernels.
xosview-1.8.0-akpm/linux/cpumeter.cc | 5 ++++-
xosview-1.8.0-akpm/linux/diskmeter.cc | 2 ++
xosview-1.8.0-akpm/linux/pagemeter.cc | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff -puN linux/diskmeter.cc~proc-stats-hang-fix linux/diskmeter.cc
--- xosview-1.8.0/linux/diskmeter.cc~proc-stats-hang-fix Thu Jun 5 16:02:34 2003
+++ xosview-1.8.0-akpm/linux/diskmeter.cc Thu Jun 5 16:02:53 2003
@@ -64,6 +64,8 @@ void DiskMeter::getdiskinfo( void )
{
stats.ignore(1024, '\n');
stats >> buf;
+ if (stats.eof())
+ break;
}
// read values
diff -puN linux/cpumeter.cc~proc-stats-hang-fix linux/cpumeter.cc
--- xosview-1.8.0/linux/cpumeter.cc~proc-stats-hang-fix Thu Jun 5 16:07:14 2003
+++ xosview-1.8.0-akpm/linux/cpumeter.cc Thu Jun 5 16:07:42 2003
@@ -58,8 +58,11 @@ void CPUMeter::getcputime( void ){
}
// read until we are at the right line.
- for (int i = 0 ; i < _lineNum ; i++)
+ for (int i = 0 ; i < _lineNum ; i++) {
+ if (stats.eof())
+ break;
stats.getline(tmp, 1024);
+ }
stats >>tmp >>cputime_[cpuindex_][0]
>>cputime_[cpuindex_][1]
diff -puN linux/pagemeter.cc~proc-stats-hang-fix linux/pagemeter.cc
--- xosview-1.8.0/linux/pagemeter.cc~proc-stats-hang-fix Thu Jun 5 16:07:55 2003
+++ xosview-1.8.0-akpm/linux/pagemeter.cc Thu Jun 5 16:08:36 2003
@@ -58,7 +58,7 @@ void PageMeter::getpageinfo( void ){
do {
stats >>buf;
- } while (strncasecmp(buf, "swap", 5));
+ } while (!stats.eof() && strncasecmp(buf, "swap", 5));
stats >>pageinfo_[pageindex_][0] >>pageinfo_[pageindex_][1];
_
prev parent reply other threads:[~2003-06-05 23:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-04 21:22 Stephen Hemminger
2003-06-04 22:32 ` jjs
2003-06-04 23:23 ` Stephen Hemminger
2003-06-05 18:12 ` Stephen Hemminger
[not found] ` <3EDFB3E2.2090308@tmsusa.com>
2003-06-05 21:33 ` Andrew Morton
2003-06-05 21:58 ` jjs
2003-06-05 22:34 ` Edward Tandi
2003-06-05 22:45 ` Andrew Morton
2003-06-06 18:48 ` Edward Tandi
2003-06-05 22:56 ` jjs
2003-06-05 23:11 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030605161132.46f793e2.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=ed@efix.biz \
--cc=linux-kernel@vger.kernel.org \
--cc=xosview-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®