diff --git a/sysdeps/common/ChangeLog b/sysdeps/common/ChangeLog index c1956e7a..4c52f235 100644 --- a/sysdeps/common/ChangeLog +++ b/sysdeps/common/ChangeLog @@ -1,3 +1,16 @@ +2006-06-24 Benoît Dejean + + * mountlist.c: (read_filesystem_list): + + Ensure file is closed. + + (glibtop_get_mountlist_s): + + Fixed .flags. + + Patch by hua.zhang@sun.com. + Closes #345812. + 2006-04-09 Benoît Dejean * Makefile.am: Fixed trivial warning. diff --git a/sysdeps/common/mountlist.c b/sysdeps/common/mountlist.c index e3825964..ad6df03d 100644 --- a/sysdeps/common/mountlist.c +++ b/sysdeps/common/mountlist.c @@ -475,10 +475,10 @@ read_filesystem_list (void) mtail = me; } - if (ret > 0) - return NULL; if (fclose (fp) == EOF) return NULL; + if (ret > 0) + return NULL; } #endif /* MOUNTED_GETMNTENT2. */ @@ -610,7 +610,7 @@ glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs) buf->total = buf->number * buf->size; buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE) - | (1 << GLIBTOP_MOUNTLIST_SIZE) + | (1 << GLIBTOP_MOUNTLIST_NUMBER) | (1 << GLIBTOP_MOUNTLIST_TOTAL); return (glibtop_mountentry*) g_array_free(mount_array, FALSE);