summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordautor <karlo98.m@gmail.com>2024-11-23 12:59:25 +0100
committerdautor <karlo98.m@gmail.com>2024-11-23 12:59:25 +0100
commitb90543d9ae3de7ae673030d4515b7effcf737ebb (patch)
tree7df8ec06c18d933a6093bce3005dedc1451e543f
parent1e8c79f75bfff6cf1cadfd3a02d04ab6c91f09b3 (diff)
Add a better error message when mounting failsHEADmaster
-rw-r--r--src/util.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/util.c b/src/util.c
index 13ba790..d7d07e7 100644
--- a/src/util.c
+++ b/src/util.c
@@ -367,12 +367,12 @@ mount_unionfs(char const *Target, char const *Source, bool Below)
char SourceR[MAXPATHLEN];
if(checkpath(Target, TargetR) != 0)
{
- fprintf(stderr, "checkpath %s\n", TargetR);
+ fprintf(stderr, "'%s' is not a valid mount target\n", TargetR);
return -1;
}
if(checkpath(Source, SourceR) != 0)
{
- fprintf(stderr, "checkpath %s\n", SourceR);
+ fprintf(stderr, "'%s' is not a valid directory\n", SourceR);
return -1;
}
if(subdir(TargetR, SourceR) || subdir(SourceR, TargetR))
@@ -391,7 +391,7 @@ mount_unionfs(char const *Target, char const *Source, bool Below)
build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
if(nmount(iov, (u32)iovlen, 0))
{
- fprintf(stderr, "nmount unionfs %s: %s\n", SourceR, errmsg);
+ fprintf(stderr, "nmount unionfs '%s' failed: %s\n", SourceR, errmsg);
return -1;
}
return 0;
@@ -403,7 +403,7 @@ mount_devfs(char const *Target)
char TargetR[MAXPATHLEN];
if(checkpath(Target, TargetR) != 0)
{
- fprintf(stderr, "checkpath %s\n", TargetR);
+ fprintf(stderr, "'%s' is not a valid mount target\n", TargetR);
return -1;
}
char errmsg[255];
@@ -416,7 +416,7 @@ mount_devfs(char const *Target)
build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
if(nmount(iov, (u32)iovlen, 0))
{
- fprintf(stderr, "nmount devfs: %s\n", errmsg);
+ fprintf(stderr, "nmount devfs failed: %s\n", errmsg);
return -1;
}
return 0;
@@ -429,12 +429,12 @@ mount_nullfs(char const *Target, char const *Source)
char SourceR[MAXPATHLEN];
if(checkpath(Target, TargetR) != 0)
{
- fprintf(stderr, "checkpath %s\n", TargetR);
+ fprintf(stderr, "'%s' is not a valid mount target\n", TargetR);
return -1;
}
if(checkpath(Source, SourceR) != 0)
{
- fprintf(stderr, "checkpath %s\n", SourceR);
+ fprintf(stderr, "'%s' is not a valid directory\n", SourceR);
return -1;
}
if(subdir(TargetR, SourceR) || subdir(SourceR, TargetR))
@@ -452,7 +452,7 @@ mount_nullfs(char const *Target, char const *Source)
build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
if(nmount(iov, (u32)iovlen, 0))
{
- fprintf(stderr, "nmount nullfs %s: %s\n", SourceR, errmsg);
+ fprintf(stderr, "nmount nullfs '%s' failed: %s\n", SourceR, errmsg);
return -1;
}
return 0;