Error messages in lfs_changelog() are updated to a standard format.
Messages are prefixed with the name of the utility and the command
that caused the error. User-provided values are delimited with
single quotes.
Test-Parameters: trivial
Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: Ib9229d13a6fa4e76ee407de33f181465adc879b6
Reviewed-on: https://review.whamcloud.com/30665
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
case 'f':
follow++;
break;
case 'f':
follow++;
break;
- case '?':
- return CMD_HELP;
- fprintf(stderr, "error: %s: option '%s' unrecognized\n",
- argv[0], argv[optind - 1]);
+ fprintf(stderr,
+ "%s changelog: unrecognized option '%s'\n",
+ progname, argv[optind - 1]);
- if (optind >= argc)
- return CMD_HELP;
+ if (optind >= argc) {
+ fprintf(stderr, "%s changelog: mdtname must be specified\n",
+ progname);
+ return CMD_HELP;
+ }
mdd = argv[optind++];
if (argc > optind)
mdd = argv[optind++];
if (argc > optind)
(follow ? CHANGELOG_FLAG_FOLLOW : 0),
mdd, startrec);
if (rc < 0) {
(follow ? CHANGELOG_FLAG_FOLLOW : 0),
mdd, startrec);
if (rc < 0) {
- fprintf(stderr, "Can't start changelog: %s\n",
- strerror(errno = -rc));
+ fprintf(stderr, "%s changelog: cannot start changelog: %s\n",
+ progname, strerror(errno = -rc));
CHANGELOG_EXTRA_FLAG_OMODE |
CHANGELOG_EXTRA_FLAG_XATTR);
if (rc < 0) {
CHANGELOG_EXTRA_FLAG_OMODE |
CHANGELOG_EXTRA_FLAG_XATTR);
if (rc < 0) {
- fprintf(stderr, "Can't set xflags for changelog: %s\n",
- strerror(errno = -rc));
+ fprintf(stderr,
+ "%s changelog: cannot set xflags for changelog: %s\n",
+ progname, strerror(errno = -rc));
printf("\n");
llapi_changelog_free(&rec);
printf("\n");
llapi_changelog_free(&rec);
- llapi_changelog_fini(&changelog_priv);
+ llapi_changelog_fini(&changelog_priv);
- if (rc < 0)
- fprintf(stderr, "Changelog: %s\n", strerror(errno = -rc));
+ if (rc < 0)
+ fprintf(stderr, "%s changelog: cannot access changelog: %s\n",
+ progname, strerror(errno = -rc));
- return (rc == 1 ? 0 : rc);
+ return (rc == 1 ? 0 : rc);
}
static int lfs_changelog_clear(int argc, char **argv)
}
static int lfs_changelog_clear(int argc, char **argv)