Change some fprintf(stderrs to cont_err()

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-05-21 12:51:33 +10:00
parent ed503f89e4
commit d33f151842
5 changed files with 15 additions and 16 deletions

13
Grow.c
View File

@ -2380,13 +2380,12 @@ static int raid10_reshape(char *container, int fd, char *devname,
err = errno; err = errno;
if (err) { if (err) {
pr_err("Cannot set array shape for %s\n", pr_err("Cannot set array shape for %s\n",
devname); devname);
if (err == EBUSY && if (err == EBUSY &&
(info->array.state & (1<<MD_SB_BITMAP_PRESENT))) (info->array.state & (1<<MD_SB_BITMAP_PRESENT)))
fprintf(stderr, cont_err(" Bitmap must be removed before"
" Bitmap must be removed before" " shape can be changed\n");
" shape can be changed\n"); goto release;
goto release;
} }
sysfs_free(sra); sysfs_free(sra);
return 0; return 0;

View File

@ -342,7 +342,7 @@ int Manage_runstop(char *devname, int fd, int runstop,
pr_err("failed to stop array %s: %s\n", pr_err("failed to stop array %s: %s\n",
devname, strerror(errno)); devname, strerror(errno));
if (errno == EBUSY) if (errno == EBUSY)
fprintf(stderr, "Perhaps a running " cont_err("Perhaps a running "
"process, mounted filesystem " "process, mounted filesystem "
"or active volume group?\n"); "or active volume group?\n");
} }

View File

@ -279,7 +279,7 @@ int main(int argc, char *argv[])
if (mode == MISC && devs_found) { if (mode == MISC && devs_found) {
pr_err("No action given for %s in --misc mode\n", pr_err("No action given for %s in --misc mode\n",
devlist->devname); devlist->devname);
fprintf(stderr," Action options must come before device names\n"); cont_err("Action options must come before device names\n");
exit(2); exit(2);
} }
} else { } else {

View File

@ -3840,9 +3840,9 @@ static int find_intel_hba_capability(int fd, struct intel_super *super, char *de
hba = hba->next; hba = hba->next;
} }
fprintf(stderr, ").\n" fprintf(stderr, ").\n");
" Mixing devices attached to multiple controllers " cont_err("Mixing devices attached to multiple controllers "
"is not allowed.\n"); "is not allowed.\n");
} }
return 2; return 2;
} }

8
util.c
View File

@ -521,7 +521,7 @@ int check_ext2(int fd, char *name)
size = sb[4]|(sb[5]|(sb[6]|sb[7]<<8)<<8)<<8; size = sb[4]|(sb[5]|(sb[6]|sb[7]<<8)<<8)<<8;
pr_err("%s appears to contain an ext2fs file system\n", pr_err("%s appears to contain an ext2fs file system\n",
name); name);
fprintf(stderr," size=%dK mtime=%s", cont_err("size=%dK mtime=%s",
size*(1<<bsize), ctime(&mtime)); size*(1<<bsize), ctime(&mtime));
return 1; return 1;
} }
@ -545,7 +545,7 @@ int check_reiser(int fd, char *name)
return 0; return 0;
pr_err("%s appears to contain a reiserfs file system\n",name); pr_err("%s appears to contain a reiserfs file system\n",name);
size = sb[0]|(sb[1]|(sb[2]|sb[3]<<8)<<8)<<8; size = sb[0]|(sb[1]|(sb[2]|sb[3]<<8)<<8)<<8;
fprintf(stderr, " size = %luK\n", size*4); cont_err("size = %luK\n", size*4);
return 1; return 1;
} }
@ -568,8 +568,8 @@ int check_raid(int fd, char *name)
crtime = info.array.ctime; crtime = info.array.ctime;
level = map_num(pers, info.array.level); level = map_num(pers, info.array.level);
if (!level) level = "-unknown-"; if (!level) level = "-unknown-";
fprintf(stderr, " level=%s devices=%d ctime=%s", cont_err("level=%s devices=%d ctime=%s",
level, info.array.raid_disks, ctime(&crtime)); level, info.array.raid_disks, ctime(&crtime));
return 1; return 1;
} }