]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxcmd: move error messages to appropriate place
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 29 Jan 2009 22:08:23 +0000 (23:08 +0100)
committerChristoph Hellwig <hch@brick.lst.de>
Thu, 29 Jan 2009 22:08:23 +0000 (23:08 +0100)
Replace raw perror() with proper message in
fs_table_initialise_mounts().

Replace raw perror() with proper message and move it from
fs_mount_point_from_path() to fs_table_initialise_projects() where this
message has meaning.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Reviewed-by: Nathan Scott <nscott@aconex.com>
Reviewed-by: Donald Douwsma <ddouwsma@bigpond.net.au>
libxcmd/paths.c

index 369c071fd11ff23ebf1c2dda2ff1768195554753..1dbe0be801bb3a24c9948258c1618a497e1c0d25 100644 (file)
@@ -248,7 +248,8 @@ fs_table_initialise_mounts(
        dir = fsname = fslog = fsrt = NULL;
 
        if ((count = getmntinfo(&stats, 0)) < 0) {
-               perror("getmntinfo");
+               fprintf(stderr, _("%s: getmntinfo() failed: %s\n"),
+                               progname, strerror(errno));
                return 0;
        }
 
@@ -298,7 +299,6 @@ fs_mount_point_from_path(
        struct stat64   s;
 
        if (stat64(dir, &s) < 0) {
-               perror(dir);
                return NULL;
        }
 
@@ -327,8 +327,11 @@ fs_table_initialise_projects(
        while ((path = getprpathent()) != NULL) {
                if (project && prid != path->pp_prid)
                        continue;
-               if ((fs = fs_mount_point_from_path(path->pp_pathname)) == NULL)
+               if ((fs = fs_mount_point_from_path(path->pp_pathname)) == NULL) {
+                       fprintf(stderr, _("%s: cannot find mount point for path `%s': %s\n"),
+                                       progname, path->pp_pathname, strerror(errno));
                        continue;
+               }
                found = 1;
                dir = strdup(path->pp_pathname);
                fsname = strdup(fs->fs_name);