From 739e9cac4aeb748ae4bfd55a8fe23ecf42dfd1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Sat, 24 Jun 2006 17:28:48 +0000 Subject: Ensure file is closed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- sysdeps/common/ChangeLog | 13 +++++++++++++ sysdeps/common/mountlist.c | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'sysdeps/common') 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); -- cgit v1.2.1