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.
This commit is contained in:
Benoît Dejean
2006-06-24 17:28:48 +00:00
committed by Benoît Dejean
parent 8c7e0e6f2e
commit 739e9cac4a
2 changed files with 16 additions and 3 deletions

View File

@@ -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> 2006-04-09 Benoît Dejean <benoit@placenet.org>
* Makefile.am: Fixed trivial warning. * Makefile.am: Fixed trivial warning.

View File

@@ -475,10 +475,10 @@ read_filesystem_list (void)
mtail = me; mtail = me;
} }
if (ret > 0)
return NULL;
if (fclose (fp) == EOF) if (fclose (fp) == EOF)
return NULL; return NULL;
if (ret > 0)
return NULL;
} }
#endif /* MOUNTED_GETMNTENT2. */ #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->total = buf->number * buf->size;
buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE) buf->flags = (1 << GLIBTOP_MOUNTLIST_SIZE)
| (1 << GLIBTOP_MOUNTLIST_SIZE) | (1 << GLIBTOP_MOUNTLIST_NUMBER)
| (1 << GLIBTOP_MOUNTLIST_TOTAL); | (1 << GLIBTOP_MOUNTLIST_TOTAL);
return (glibtop_mountentry*) g_array_free(mount_array, FALSE); return (glibtop_mountentry*) g_array_free(mount_array, FALSE);