summaryrefslogtreecommitdiff
path: root/quotaon_xfs.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2001-05-02 09:32:22 +0000
committerjkar8572 <jkar8572>2001-05-02 09:32:22 +0000
commit84ec12aa207cb8d5323b63847bfd8115881f2886 (patch)
tree9533951fedda68167081028741a9ec3fd8ad547b /quotaon_xfs.c
parent9c4a512419c660c0513db48e038169167e3e7d25 (diff)
Added mntopt.h to dependencies in Makefile.in.
Fixed MNTTYPE_REISER to proper string. sprintf->snprintf Merged Marco's patch with errstr(), configurable BSD behaviour Fixed bug in quota detection IO code now opens file only RO if possible. IO code now doesn't open file if not required. Fixed bug in quotaon. Updated all manpages.
Diffstat (limited to 'quotaon_xfs.c')
-rw-r--r--quotaon_xfs.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/quotaon_xfs.c b/quotaon_xfs.c
index 4252fcf..f9d1918 100644
--- a/quotaon_xfs.c
+++ b/quotaon_xfs.c
@@ -31,8 +31,7 @@ static int xfs_state_check(int qcmd, int type, int flags, char *dev, int root, i
return 0; /* noop */
if (quotactl(QCMD(Q_XFS_GETQSTAT, 0), dev, 0, (void *)&info) < 0) {
- fprintf(stderr, flags & STATEFLAG_ON ? "quotaon: " : "quotaoff: ");
- perror(dev);
+ errstr(_("quotactl() on %s: %s\n"), dev, strerror(errno));
return -1;
}
@@ -64,7 +63,7 @@ static int xfs_state_check(int qcmd, int type, int flags, char *dev, int root, i
" (reboot to take effect)\n"), type2name(type));
return 1;
}
- fprintf(stderr, _("Enable XFS %s quota during mount\n"),
+ errstr(_("Enable XFS %s quota during mount\n"),
type2name(type));
return -1;
case Q_XFS_QUOTAOFF:
@@ -74,7 +73,7 @@ static int xfs_state_check(int qcmd, int type, int flags, char *dev, int root, i
case ACCT:
switch (qcmd) {
case Q_XFS_QUOTARM:
- fprintf(stderr, _("Cannot delete %s quota on %s - "
+ errstr(_("Cannot delete %s quota on %s - "
"switch quota accounting off first\n"),
type2name(type), dev);
return -1;
@@ -100,12 +99,12 @@ static int xfs_state_check(int qcmd, int type, int flags, char *dev, int root, i
case ENFD:
switch (qcmd) {
case Q_XFS_QUOTARM:
- fprintf(stderr, _("Cannot delete %s quota on %s - "
+ errstr(_("Cannot delete %s quota on %s - "
"switch quota enforcement off first\n"),
type2name(type), dev);
return -1;
case Q_XFS_QUOTAON:
- fprintf(stderr, _("Enforcing %s quota already on %s\n"),
+ errstr(_("Enforcing %s quota already on %s\n"),
type2name(type), dev);
return -1;
case Q_XFS_QUOTAOFF:
@@ -116,7 +115,7 @@ static int xfs_state_check(int qcmd, int type, int flags, char *dev, int root, i
}
break;
}
- fprintf(stderr, _("Unexpected XFS quota state sought on %s\n"), dev);
+ errstr(_("Unexpected XFS quota state sought on %s\n"), dev);
return -1;
}
@@ -131,8 +130,7 @@ static int xfs_onoff(char *dev, int type, int flags, int rootfs, int *xopts)
return (check < 0);
if (quotactl(QCMD(qcmd, type), dev, 0, (void *)xopts) < 0) {
- fprintf(stderr, qoff ? "quotaoff: " : "quotaon: ");
- perror(dev);
+ errstr(_("quotactl on %s: %s\n"), dev, strerror(errno));
return 1;
}
if ((flags & STATEFLAG_VERBOSE) && qoff)
@@ -152,8 +150,8 @@ static int xfs_delete(char *dev, int type, int flags, int rootfs, int *xopts)
return (check < 0);
if (quotactl(QCMD(qcmd, type), dev, 0, (void *)xopts) < 0) {
- fprintf(stderr, _("Failed to delete quota: "));
- perror(dev);
+ errstr(_("Failed to delete quota: %s"),
+ strerror(errno));
return 1;
}