tmp = &errbuf[spos];
if (cf_stat == RPC_SYSTEMERROR)
pos = snprintf(tmp, (erreob - tmp),
- "System Error: %s", strerror(cf_errno));
+ _("System Error: %s"),
+ strerror(cf_errno));
else
- pos = snprintf(tmp, (erreob - tmp), "RPC Error:%s", estr);
+ pos = snprintf(tmp, (erreob - tmp),
+ _("RPC Error:%s"), estr);
}
return pos;
}
tmp = &errbuf[pos];
if (bg)
pos = snprintf(tmp, (erreob - tmp),
- "mount to NFS server '%s' failed: ", server);
+ _("mount to NFS server '%s' failed: "),
+ server);
else
pos = snprintf(tmp, (erreob - tmp),
- "%s: mount to NFS server '%s' failed: ",
- progname, server);
+ _("%s: mount to NFS server '%s' failed: "),
+ progname, server);
tmp = &errbuf[pos];
if (rpc_createerr.cf_stat == RPC_TIMEDOUT) {
- pos = snprintf(tmp, (erreob - tmp), "timed out %s",
- will_retry ? "(retrying)" : "(giving up)");
+ if (will_retry)
+ pos = snprintf(tmp, (erreob - tmp),
+ _("timed out, retrying"));
+ else
+ pos = snprintf(tmp, (erreob - tmp),
+ _("timed out, giving up"));
} else {
pos += rpc_strerror(pos);
tmp = &errbuf[pos];
if (bg) {
- pos = snprintf(tmp, (erreob - tmp), " %s",
- will_retry ? "(retrying)" : "(giving up)");
+ if (will_retry)
+ pos = snprintf(tmp, (erreob - tmp),
+ _(", retrying"));
+ else
+ pos = snprintf(tmp, (erreob - tmp),
+ _(", giving up"));
}
}
+
if (bg) {
if (onlyonce++ < 1)
openlog("mount", LOG_CONS|LOG_PID, LOG_AUTH);
- syslog(LOG_ERR, "%s.", errbuf);
+ syslog(LOG_ERR, "%s", errbuf);
} else
- fprintf(stderr, "%s.\n", errbuf);
+ fprintf(stderr, "%s\n", errbuf);
}
void mount_error(const char *spec, const char *mount_point, int error)
static void print_one(char *spec, char *node, char *type, char *opts)
{
- if (verbose) {
- printf("%s on %s type %s", spec, node, type);
+ if (!verbose)
+ return;
- if (opts != NULL)
- printf(" (%s)", opts);
-
- printf("\n");
- }
+ if (opts)
+ printf(_("%s on %s type %s (%s)\n"), spec, node, type, opts);
+ else
+ printf(_("%s on %s type %s\n"), spec, node, type);
}
/*
void mount_usage(void)
{
- printf("usage: %s remotetarget dir [-rvVwfnh] [-o nfsoptions]\n",
+ printf(_("usage: %s remotetarget dir [-rvVwfnh] [-o nfsoptions]\n"),
progname);
- printf("options:\n");
- printf("\t-r\t\tMount file system readonly\n");
- printf("\t-v\t\tVerbose\n");
- printf("\t-V\t\tPrint version\n");
- printf("\t-w\t\tMount file system read-write\n");
- printf("\t-f\t\tFake mount, do not actually mount\n");
- printf("\t-n\t\tDo not update /etc/mtab\n");
- printf("\t-s\t\tTolerate sloppy mount options rather than failing.\n");
- printf("\t-h\t\tPrint this help\n");
- printf("\tnfsoptions\tRefer to mount.nfs(8) or nfs(5)\n\n");
+ printf(_("options:\n"));
+ printf(_("\t-r\t\tMount file system readonly\n"));
+ printf(_("\t-v\t\tVerbose\n"));
+ printf(_("\t-V\t\tPrint version\n"));
+ printf(_("\t-w\t\tMount file system read-write\n"));
+ printf(_("\t-f\t\tFake mount, do not actually mount\n"));
+ printf(_("\t-n\t\tDo not update /etc/mtab\n"));
+ printf(_("\t-s\t\tTolerate sloppy mount options rather than failing.\n"));
+ printf(_("\t-h\t\tPrint this help\n"));
+ printf(_("\tnfsoptions\tRefer to mount.nfs(8) or nfs(5)\n\n"));
}
static void parse_opt(const char *opt, int *mask, char *extra_opts, int len)
else if (!strcmp(opt, "sharecache"))
unshared = !val;
else if (!sloppy) {
- printf(_("unknown nfs mount option: "
- "%s%s\n"), val ? "" : "no", opt);
+ printf(_("unknown nfs mount option: %s%s\n"),
+ val ? "" : "no", opt);
goto fail;
}
}
if ((opteq = strchr(opt, '=')) && isdigit(opteq[1])) {
int val = atoi(opteq + 1);
*opteq = '\0';
-/* printf("opt=%s\n", opt); */
if (!strcmp(opt, "rsize"))
data->rsize = val;
else if (!strcmp(opt, "wsize"))
val ? "" : "no", opt);
goto out_bad;
}
- sprintf(cbuf, val ? "%s,":"no%s,", opt);
+ sprintf(cbuf, val ? "%s," : "no%s,", opt);
}
len += strlen(cbuf);
if (len >= opt_size) {
res = umount2 (node, MNT_FORCE);
if (res == -1) {
int errsv = errno;
- perror("umount2");
+ perror(_("umount2"));
errno = errsv;
if (errno == ENOSYS) {
if (verbose)
update_mtab(node, &remnt);
return 0;
} else if (errno != EBUSY) { /* hmm ... */
- perror("remount");
+ perror(_("remount"));
nfs_error(_("%s: could not remount %s read-only"),
progname, spec);
}
if (res >= 0) {
/* Umount succeeded */
if (verbose)
- printf (_("%s umounted\n"), spec ? spec : node);
+ printf(_("%s umounted\n"), spec ? spec : node);
}
writemtab:
static void umount_usage(void)
{
- printf("usage: %s dir [-fvnrlh]\n", progname);
- printf("options:\n\t-f\t\tforce unmount\n");
- printf("\t-v\t\tverbose\n");
- printf("\t-n\t\tDo not update /etc/mtab\n");
- printf("\t-r\t\tremount\n");
- printf("\t-l\t\tlazy unmount\n");
- printf("\t-h\t\tprint this help\n\n");
+ printf(_("usage: %s dir [-fvnrlh]\n"), progname);
+ printf(_("options:\n\t-f\t\tforce unmount\n"));
+ printf(_("\t-v\tverbose\n"));
+ printf(_("\t-n\tDo not update /etc/mtab\n"));
+ printf(_("\t-r\tremount\n"));
+ printf(_("\t-l\tlazy unmount\n"));
+ printf(_("\t-h\tprint this help\n\n"));
}
int nfsumount(int argc, char *argv[])
if (mc && strcmp(mc->m.mnt_type, "nfs") != 0 &&
strcmp(mc->m.mnt_type, "nfs4") != 0) {
- nfs_error(_("%s: %s on %s it not an nfs filesystem"),
+ nfs_error(_("%s: %s on %s is not an NFS filesystem"),
progname, mc->m.mnt_fsname, mc->m.mnt_dir);
return EX_USAGE;
}