diff options
author | Benoît Dejean <benoit@placenet.org> | 2006-06-24 17:28:48 +0000 |
---|---|---|
committer | Benoît Dejean <bdejean@src.gnome.org> | 2006-06-24 17:28:48 +0000 |
commit | 739e9cac4aeb748ae4bfd55a8fe23ecf42dfd1bb (patch) | |
tree | 39bdc8d9947b7a360924e3d5503ddbc654622a7c /sysdeps/common | |
parent | 8c7e0e6f2eb4027a82e7a745bb26a8880b06bf3a (diff) | |
download | libgtop-739e9cac4aeb748ae4bfd55a8fe23ecf42dfd1bb.tar.gz |
Ensure file is closed.
2006-06-24 Benoît Dejean <benoit@placenet.org>
* mountlist.c: (read_filesystem_list):
Ensure file is closed.
(glibtop_get_mountlist_s):
Fixed .flags.
Patch by hua.zhang@sun.com.
Closes #345812.
Diffstat (limited to 'sysdeps/common')
-rw-r--r-- | sysdeps/common/ChangeLog | 13 | ||||
-rw-r--r-- | sysdeps/common/mountlist.c | 6 |
2 files changed, 16 insertions, 3 deletions
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 <benoit@placenet.org> + + * 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 <benoit@placenet.org> * 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); |