diff options
author | Christoph Hellwig <hch@lst.de> | 2009-02-23 14:24:50 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@brick.lst.de> | 2009-02-23 14:24:50 +0100 |
commit | b7b66942273709925184998fb08283e279e0366f (patch) | |
tree | 21595496a6bae5bf4a72c6c464a9428b2c50c8af | |
parent | 669c7b27a2f471215afbc69f609cb7d2179dea40 (diff) | |
download | xfsdump-dev-b7b66942273709925184998fb08283e279e0366f.tar.gz |
xfsdump: fix system() error reporting
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>
Reviewed-by: Timothy Shimmin <timothy.shimmin@gmail.com>
-rw-r--r-- | dump/content.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dump/content.c b/dump/content.c index 5d6e7512..e06e6e09 100644 --- a/dump/content.c +++ b/dump/content.c @@ -6735,7 +6735,8 @@ save_quotas( char *mntpnt, quota_info_t *quotainfo ) 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) { |