xfs
[Top] [All Lists]

Re: [PATCH] xfsdump: fix system() error reporting

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfsdump: fix system() error reporting
From: Timothy Shimmin <timothy.shimmin@xxxxxxxxx>
Date: Tue, 17 Feb 2009 11:08:33 +1100
Cc: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JM02CrtUZH61gCBDB5L5W0XqYMwGFEC9dqTo4OY65tM=; b=h6/VU70ma7tjO/fbNcTf30RKFVsdF31D61T/KsFxzgwFK55rnNO3QIV1vP7AfJqtg8 Td0keepFt6M6g7wklH4fZ2y6F6dC4RMxMooBtsosWEq8Mus/F5EeaFKhZyURqolgrKS+ Vqkj3fMU92mqWtp0C0pMEMiTCk9LaAhwanNgM=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rqzEUeROCCeqBn3mXtTA3Sns4Vv7aNf0MoY6MJWADpLK/CdI1x+XadTVOZNKGW9xKb GdllwnhIiHc5iDfAdstVhcWTM3lGBVl+f5YR9aCedVSqHZiB4vc7LN/qz4k7fX4pRGfm QZGSwn52NGPPW9f+Pu6uH4Y/R57Pxi5ey1G6k=
In-reply-to: <20090216102845.GA6835@xxxxxxxxxxxxx>
References: <20090216102845.GA6835@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx> 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@xxxxxx>
>
> 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@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs
>

<Prev in Thread] Current Thread [Next in Thread>