Added -gnu89 to CFLAGS.
* configure.in: Added -gnu89 to CFLAGS. * examples/Makefile.am: Fixed LDFLAGS. * sysdeps/common/fsusage.c: (glibtop_get_fsusage_s): * sysdeps/linux/fsusage.c: (linux_2_6_0): * sysdeps/linux/proctime.c: (glibtop_get_proc_time_s): * sysdeps/linux/sysinfo.c: (init_sysinfo): Fixed C89 issues. Closes #149375.
This commit is contained in:
@@ -30,7 +30,8 @@ static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
|
||||
{
|
||||
if(strcmp(emnt->mnt_dir, path) != 0)
|
||||
continue;
|
||||
|
||||
else
|
||||
{
|
||||
char filename[64]; /* magic */
|
||||
|
||||
char buffer[1024]; /* magic */
|
||||
@@ -75,6 +76,7 @@ static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
|
||||
buf->read = strtoull(p, &p, 0);
|
||||
p = skip_token(p);
|
||||
buf->write = strtoull(p, &p, 0);
|
||||
}
|
||||
}
|
||||
|
||||
endmntent(mtab);
|
||||
|
@@ -74,9 +74,10 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
|
||||
|
||||
p = skip_multiple_token (p, 3);
|
||||
|
||||
// timeout is 0 on 2.4 and "thread_number" on 2.6
|
||||
// lets skip it (using previous skip_multiple_token)
|
||||
// buf->timeout = strtoull (p, &p, 0);
|
||||
/* timeout is 0 on 2.4 and "thread_number" on 2.6
|
||||
lets skip it (using previous skip_multiple_token)
|
||||
buf->timeout = strtoull (p, &p, 0);
|
||||
*/
|
||||
buf->it_real_value = strtoull (p, &p, 0);
|
||||
|
||||
/* seconds since epoch */
|
||||
|
@@ -37,6 +37,7 @@ static void
|
||||
init_sysinfo (glibtop *server)
|
||||
{
|
||||
char buffer [BUFSIZ];
|
||||
gchar ** processors;
|
||||
|
||||
if(G_LIKELY(sysinfo.flags)) return;
|
||||
|
||||
@@ -45,8 +46,7 @@ init_sysinfo (glibtop *server)
|
||||
file_to_buffer(server, buffer, FILENAME);
|
||||
|
||||
/* cpuinfo records are seperated by a blank line */
|
||||
gchar ** const processors = g_strsplit(buffer, "\n\n", 0);
|
||||
|
||||
processors = g_strsplit(buffer, "\n\n", 0);
|
||||
|
||||
for(sysinfo.ncpu = 0;
|
||||
sysinfo.ncpu < GLIBTOP_NCPU && processors[sysinfo.ncpu] && *processors[sysinfo.ncpu];
|
||||
|
Reference in New Issue
Block a user