From 0b4f757b2b1d4f791ef85e1f2533587afbafd203 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Tue, 7 Jul 1998 00:10:49 +0000 Subject: using functions from `xmalloc.c'. 1998-07-06 Martin Baulig * sysdeps/common/mountlist.c: using functions from `xmalloc.c'. * sysdeps/common/error.c: all functions now accept NULL as `server' argument. --- ChangeLog | 15 +++++++++++++++ sysdeps/common/error.c | 10 ++++++---- sysdeps/common/mountlist.c | 10 ++++++---- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a24ded4..ee38badc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 1998-07-06 Martin Baulig + * sysdeps/common/mountlist.c: using functions from `xmalloc.c'. + + * sysdeps/common/error.c: all functions now accept NULL as + `server' argument. + + * acconfig.h (AFS, MOUNTED_FREAD, MOUNTED_FREAD_FSTYP, + MOUNTED_GETFSSTAT, MOUNTED_GETMNT, MOUNTED_GETMNTENT1, + MOUNTED_GETMNTENT2, MOUNTED_GETMNTINFO, MOUNTED_LISTMNTENT, + MOUNTED_VMOUNT, STAT_STATFS3_OSF1, STAT_READ_FILSYS, + STAT_STATFS2_BSIZE, STAT_STATFS2_FSIZE, STAT_STATFS2_FS_DATA, + STAT_STATFS4, STAT_STATVFS, STATFS_TRUNCATES_BLOCK_COUNTS): + New macros. + + * configure.in: added GNOME_FILEUTILS_CHECKS. + * sysdeps/common/{fsusage, mountlist}.[ch]: Imported from GNU Fileutils 3.16. diff --git a/sysdeps/common/error.c b/sysdeps/common/error.c index 55e9e265..df01ede8 100644 --- a/sysdeps/common/error.c +++ b/sysdeps/common/error.c @@ -21,6 +21,8 @@ #include +#define DEFAULT_NAME "ERROR" + /* Prints error message and exits. */ void @@ -30,7 +32,7 @@ glibtop_error_r (glibtop *server, char *format, ...) va_start (ap, format); - fprintf (stderr, "%s: ", server->name); + fprintf (stderr, "%s: ", server ? server->name : DEFAULT_NAME); vfprintf (stderr, format, ap); fprintf (stderr, "\n"); @@ -45,7 +47,7 @@ glibtop_error_io_r (glibtop *server, char *format, ...) va_start (ap, format); - fprintf (stderr, "%s: ", server->name); + fprintf (stderr, "%s: ", server ? server->name : DEFAULT_NAME); vfprintf (stderr, format, ap); fprintf (stderr, ": %s\n", strerror (errno)); @@ -60,7 +62,7 @@ glibtop_warn_r (glibtop *server, char *format, ...) va_start (ap, format); - fprintf (stderr, "%s: ", server->name); + fprintf (stderr, "%s: ", server ? server->name : DEFAULT_NAME); vfprintf (stderr, format, ap); fprintf (stderr, "\n"); @@ -74,7 +76,7 @@ glibtop_warn_io_r (glibtop *server, char *format, ...) va_start (ap, format); - fprintf (stderr, "%s: ", server->name); + fprintf (stderr, "%s: ", server ? server->name : DEFAULT_NAME); vfprintf (stderr, format, ap); fprintf (stderr, ": %s\n", strerror (errno)); diff --git a/sysdeps/common/mountlist.c b/sysdeps/common/mountlist.c index c56824be..69768d10 100644 --- a/sysdeps/common/mountlist.c +++ b/sysdeps/common/mountlist.c @@ -34,15 +34,17 @@ void free (); #include #endif -#include +#include +#include #undef xmalloc #undef xrealloc #undef xstrdup -#define xmalloc g_malloc -#define xrealloc g_realloc -#define xstrdup g_strdup +#define xmalloc(p1) glibtop_malloc_r (NULL, p1) +#define xrealloc(p1,p2) glibtop_realloc_r (NULL, p1, p2) +#define xstrdup(p1) glibtop_strdup_r (NULL, p1) +#define xfree(p1) glibtop_free_r (NULL, p1) char *strstr (); void error (); -- cgit v1.2.1