From: Ben Gamari <bgamari.foss@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Ben Gamari <bgamari.foss@gmail.com>
Subject: [PATCH] Improve error handling in filesystem df
Date: Sun, 19 Dec 2010 17:29:41 -0500 [thread overview]
Message-ID: <1292797781-3877-1-git-send-email-bgamari.foss@gmail.com> (raw)
The return values of ioctl weren't being printed to stderr on failure,
causing the command to silently fail, resulting in a very confused
user.
Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
---
btrfs_cmds.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
index 8031c58..45da2bd 100644
--- a/btrfs_cmds.c
+++ b/btrfs_cmds.c
@@ -857,6 +857,7 @@ int do_df_filesystem(int nargs, char **argv)
ret = ioctl(fd, BTRFS_IOC_SPACE_INFO, sargs);
if (ret) {
+ fprintf(stderr, "ERROR: can't query '%s' for free space (%s)\n", path, strerror(-ret));
free(sargs);
return ret;
}
@@ -875,6 +876,7 @@ int do_df_filesystem(int nargs, char **argv)
ret = ioctl(fd, BTRFS_IOC_SPACE_INFO, sargs);
if (ret) {
+ fprintf(stderr, "ERROR: can't query '%s' for free space (%s)\n", path, strerror(-ret));
free(sargs);
return ret;
}
--
1.7.1
next reply other threads:[~2010-12-19 22:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-19 22:29 Ben Gamari [this message]
2010-12-20 20:16 ` [PATCH] Improve error handling in filesystem df Goffredo Baroncelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292797781-3877-1-git-send-email-bgamari.foss@gmail.com \
--to=bgamari.foss@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).