From: Christoph Hellwig <hch@infradead.org>
To: xfs@oss.sgi.com
Subject: [PATCH] xfsdump: fix system() error reporting
Date: Mon, 16 Feb 2009 05:28:45 -0500 [thread overview]
Message-ID: <20090216102845.GA6835@infradead.org> (raw)
Positive returns from system need the WEXITSTATUS macro applies to get
the real exit code of the executed command.
Based on analysis in oss BZ #804.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: xfsdump-dev/dump/content.c
===================================================================
--- xfsdump-dev.orig/dump/content.c 2009-02-16 11:23:10.361944048 +0100
+++ xfsdump-dev/dump/content.c 2009-02-16 11:23:47.629070808 +0100
@@ -6735,7 +6735,8 @@ save_quotas( char *mntpnt, quota_info_t
sts = system( buf );
if( sts != 0 ) {
mlog( MLOG_ERROR, _(
- "%s failed with exit status: %d\n"), REPQUOTA, sts);
+ "%s failed with exit status: %d\n"), REPQUOTA,
+ sts == -1 ? -1 : WEXITSTATUS(sts));
return BOOL_FALSE;
}
if((fd = open( quotainfo->quotapath, O_RDONLY|O_DSYNC)) < 0) {
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2009-02-16 10:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-16 10:28 Christoph Hellwig [this message]
2009-02-17 0:08 ` [PATCH] xfsdump: fix system() error reporting Timothy Shimmin
2009-02-17 9:38 ` Christoph Hellwig
2009-02-18 6:38 ` Timothy Shimmin
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=20090216102845.GA6835@infradead.org \
--to=hch@infradead.org \
--cc=xfs@oss.sgi.com \
/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