summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2005-06-24 14:04:23 +0000
committerjkar8572 <jkar8572>2005-06-24 14:04:23 +0000
commit3175710dd6061c9f3df49e24728b93b4d8f29f89 (patch)
tree88549a37d39d8b9c793a3b85b0c2d6188a72da53
parentc1f3d672a89843a3538e8e327b5084b6dd59e990 (diff)
Error messages fixes (Dmitry V. Levin)
-rw-r--r--Changelog2
-rw-r--r--common.h10
-rw-r--r--quotacheck.c8
-rw-r--r--quotacheck.h2
-rw-r--r--warnquota.c4
5 files changed, 17 insertions, 9 deletions
diff --git a/Changelog b/Changelog
index 1df5d26..0273fde 100644
--- a/Changelog
+++ b/Changelog
@@ -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)
diff --git a/common.h b/common.h
index 25eac55..3aff238 100644
--- a/common.h
+++ b/common.h
@@ -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? */