Reverted some stuff from 06-07-1998 since it was too buggy.
1998-06-18 Martin Baulig <baulig@taurus.uni-trier.de> * sysdeps/linux/*.c: Reverted some stuff from 06-07-1998 since it was too buggy.
This commit is contained in:
committed by
Martin Baulig
parent
3fcc477b25
commit
1b90ed4fcc
@@ -47,36 +47,20 @@ glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pid != server->machine.last_pid) {
|
||||
server->machine.last_pid = pid;
|
||||
server->machine.no_update = 0;
|
||||
}
|
||||
|
||||
if (!server->machine.no_update) {
|
||||
server->machine.proc_status [0] = 0;
|
||||
server->machine.proc_statm [0] = 0;
|
||||
server->machine.proc_stat [0] = 0;
|
||||
}
|
||||
|
||||
if (server->machine.proc_stat [0]) {
|
||||
strcpy (buffer, server->machine.proc_stat);
|
||||
} else {
|
||||
sprintf (input, "/proc/%d/stat", pid);
|
||||
sprintf (input, "/proc/%d/stat", pid);
|
||||
|
||||
fd = open (input, O_RDONLY);
|
||||
if (fd == -1)
|
||||
glibtop_error_r (server, "open (%s): %s",
|
||||
input, strerror (errno));
|
||||
fd = open (input, O_RDONLY);
|
||||
if (fd == -1)
|
||||
glibtop_error_r (server, "open (%s): %s",
|
||||
input, strerror (errno));
|
||||
|
||||
nread = read (fd, buffer, BUFSIZ);
|
||||
if (nread == -1)
|
||||
glibtop_error_r (server, "read (%s): %s",
|
||||
input, strerror (errno));
|
||||
nread = read (fd, buffer, BUFSIZ);
|
||||
if (nread == -1)
|
||||
glibtop_error_r (server, "read (%s): %s",
|
||||
input, strerror (errno));
|
||||
|
||||
buffer [nread] = 0;
|
||||
strcpy (server->machine.proc_stat, buffer);
|
||||
close (fd);
|
||||
}
|
||||
buffer [nread] = 0;
|
||||
close (fd);
|
||||
|
||||
/* This is from guile-utils/gtop/proc/readproc.c */
|
||||
|
||||
|
Reference in New Issue
Block a user