From 2dc529b19f0363ada0a78c7979b8b628948115ca Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sun, 24 Oct 1999 19:16:52 +0000 Subject: [PATCH] New static variable. (glibtop_get_fsusage_s): Return -1 on error; 1999-10-24 Martin Baulig * fsusage.c (_glibtop_sysdeps_fsusage): New static variable. (glibtop_get_fsusage_s): Return -1 on error; otherwise set the features and return 0. --- sysdeps/common/ChangeLog | 4 ++++ sysdeps/common/fsusage.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sysdeps/common/ChangeLog b/sysdeps/common/ChangeLog index 9e50b672..062c0198 100644 --- a/sysdeps/common/ChangeLog +++ b/sysdeps/common/ChangeLog @@ -1,5 +1,9 @@ 1999-10-24 Martin Baulig + * fsusage.c (_glibtop_sysdeps_fsusage): New static variable. + (glibtop_get_fsusage_s): Return -1 on error; otherwise set the + features and return 0. + * xmalloc.c: Use glib's malloc functions when compiled with LIBGTOP_USE_GLIB_MALLOC. diff --git a/sysdeps/common/fsusage.c b/sysdeps/common/fsusage.c index e1b56b63..58cffd38 100644 --- a/sysdeps/common/fsusage.c +++ b/sysdeps/common/fsusage.c @@ -66,6 +66,11 @@ int statvfs (); #include #include +static const unsigned long _glibtop_sysdeps_fsusage = +(1L << GLIBTOP_FSUSAGE_BLOCKS) + (1L << GLIBTOP_FSUSAGE_BFREE) + +(1L << GLIBTOP_FSUSAGE_BAVAIL) + (1L << GLIBTOP_FSUSAGE_FILES) + +(1L << GLIBTOP_FSUSAGE_FFREE); + static int get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp); @@ -291,11 +296,15 @@ glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf, memset (buf, 0, sizeof (glibtop_fsusage)); if (get_fs_usage (disk, disk, &fsp)) - return; + return -1; buf->blocks = fsp.fsu_blocks; buf->bfree = fsp.fsu_bfree; buf->bavail = fsp.fsu_bavail; buf->files = fsp.fsu_files; buf->ffree = fsp.fsu_ffree; + + buf->flags = _glibtop_sysdeps_fsusage; + + return 0; }