scst_pres: Make a few error messages more clear

Make it possible to figure out what went wrong from inspecting the
system log only by mentioning the incorrect filename in the system
log.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5733 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-08-27 02:42:35 +00:00
parent 87c6bba994
commit 0cb3147ba6
+5 -3
View File
@@ -1111,19 +1111,21 @@ int scst_pr_set_file_name(struct scst_device *dev, char **prev,
res = -EINVAL;
if (pr_file_name[0] != '/') {
PRINT_ERROR("PR file name must be absolute!");
PRINT_ERROR("PR file name %s must be absolute!", pr_file_name);
goto out;
}
file_mode = scst_get_file_mode(pr_file_name);
if (file_mode >= 0 && !S_ISREG(file_mode) && !S_ISBLK(file_mode)) {
PRINT_ERROR("PR file name must be file or block device!");
PRINT_ERROR("PR file name %s must be file or block device!",
pr_file_name);
goto out;
}
res = -ENOENT;
if (!scst_parent_dir_exists(pr_file_name)) {
PRINT_ERROR("PR file name parent directory doesn't exist");
PRINT_ERROR("PR file name %s parent directory doesn't exist",
pr_file_name);
goto out;
}