[PATCH] xfsdump: fix system() error reporting
Timothy Shimmin
timothy.shimmin at gmail.com
Mon Feb 16 18:08:33 CST 2009
Hi Christoph,
Looks reasonable.
Though, in the case of returning -1, it might be more interesting
to know the value of errno ? (I presume errno would be set in that case).
--Tim
On Mon, Feb 16, 2009 at 9:28 PM, Christoph Hellwig <hch at infradead.org> wrote:
> 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 at 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 at oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
More information about the xfs
mailing list