diff options
-rw-r--r-- | Changelog | 2 | ||||
-rw-r--r-- | common.h | 10 | ||||
-rw-r--r-- | quotacheck.c | 8 | ||||
-rw-r--r-- | quotacheck.h | 2 | ||||
-rw-r--r-- | warnquota.c | 4 |
5 files changed, 17 insertions, 9 deletions
@@ -1,4 +1,6 @@ Changes in quota-tools from 3.12 to 3.13 +* fixed mistakes in several error messages, improved error reporting functions + (Dmitry V. Levin) * volume label and UUID support for reiserfs (Jan Kara) * support for LABEL= and UUID= on a command line (Jan Kara) * parse NFSD export table to find pseudofilesystem root for NFSv4 (Jan Kara) @@ -7,16 +7,22 @@ #ifndef _COMMON_H #define _COMMON_H +#ifndef __attribute__ +# if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# define __attribute__(x) +# endif +#endif + #define MY_EMAIL "mvw@planets.elm.net, jack@suse.cz" /* Name of current program for error reporting */ extern char *progname; /* Finish programs being */ -void die(int, char *, ...); +void die(int, char *, ...) __attribute__ ((__format__ (__printf__, 2, 3))); /* Print an error */ -void errstr(char *, ...); +void errstr(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); /* If use_syslog is called, all error reports using errstr() and die() are * written to syslog instead of stderr */ diff --git a/quotacheck.c b/quotacheck.c index 62a0e0b..d18a99b 100644 --- a/quotacheck.c +++ b/quotacheck.c @@ -8,7 +8,7 @@ * New quota format implementation - Jan Kara <jack@suse.cz> - Sponsored by SuSE CR */ -#ident "$Id: quotacheck.c,v 1.46 2005/03/31 11:48:02 jkar8572 Exp $" +#ident "$Id: quotacheck.c,v 1.47 2005/06/24 14:04:23 jkar8572 Exp $" #include <dirent.h> #include <stdio.h> @@ -124,7 +124,7 @@ static int store_dlinks(int type, ino_t i_num) struct dlinks *lptr; uint hash = hash_ino(i_num); - debug(FL_DEBUG, _("Adding hardlink for ino %d\n"), i_num); + debug(FL_DEBUG, _("Adding hardlink for ino %llu\n"), (unsigned long long)i_num); for (lptr = links_hash[type][hash]; lptr; lptr = lptr->next) if (lptr->i_num == i_num) @@ -838,9 +838,9 @@ static void check_dir(struct mntent *mnt) int remounted = 0; if (lstat(mnt->mnt_dir, &st) < 0) - die(2, _("Cannot stat mountpoint %s: %s\n"), mnt, strerror(errno)); + die(2, _("Cannot stat mountpoint %s: %s\n"), mnt->mnt_dir, strerror(errno)); if (!S_ISDIR(st.st_mode)) - die(2, _("Mountpoint %s isn't a directory?!\n"), mnt); + die(2, _("Mountpoint %s isn't a directory?!\n"), mnt->mnt_dir); cur_dev = st.st_dev; files_done = dirs_done = 0; if (ucheck) diff --git a/quotacheck.h b/quotacheck.h index 10ac6d1..a4f8955 100644 --- a/quotacheck.h +++ b/quotacheck.h @@ -36,7 +36,7 @@ extern size_t free_mem = 0; #endif void *xmalloc(size_t size); -void debug(int df, char *fmtstr, ...); +void debug(int df, char *fmtstr, ...) __attribute__ ((__format__ (__printf__, 2, 3))); int ask_yn(char *q, int def); struct dquot *lookup_dquot(qid_t id, int type); struct dquot *add_dquot(qid_t id, int type); diff --git a/warnquota.c b/warnquota.c index 9eefa89..1c7b405 100644 --- a/warnquota.c +++ b/warnquota.c @@ -10,7 +10,7 @@ * * Author: Marco van Wieringen <mvw@planets.elm.net> * - * Version: $Id: warnquota.c,v 1.21 2004/05/24 19:39:15 jkar8572 Exp $ + * Version: $Id: warnquota.c,v 1.22 2005/06/24 14:04:23 jkar8572 Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -653,7 +653,7 @@ int readconfigfile(const char *filename, struct configparams *config) } len = bufpos + strlen(buff+bufpos); if (buff[len-1] != '\n') - errstr(_("Line %d too long. Truncating.\n")); + errstr(_("Line %d too long. Truncating.\n"), line); else { len--; if (buff[len-1] == '\\') { /* Should join with next line? */ |