This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch] Fix build problem with system call in compile/compile.c
- From: Chen Gang S <gang dot chen at sunrus dot com dot cn>
- To: Pedro Alves <palves at redhat dot com>, sellcey at imgtec dot com
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, "Maciej W. Rozycki" <macro at linux-mips dot org>, Joel Brobecker <brobecker at adacore dot com>, gdb-patches at sourceware dot org, Yao Qi <yao at codesourcery dot com>
- Date: Fri, 09 Jan 2015 18:50:29 +0800
- Subject: Re: [Patch] Fix build problem with system call in compile/compile.c
- Authentication-results: sourceware.org; auth=none
- References: <c2ab3326-5227-43ff-a755-35cf75e209d8 at BAMAIL02 dot ba dot imgtec dot org> <20150106041615 dot GJ5445 at adacore dot com> <1420560255 dot 15691 dot 21 dot camel at ubuntu-sellcey> <20150107041351 dot GN5445 at adacore dot com> <1420655766 dot 15691 dot 44 dot camel at ubuntu-sellcey> <alpine dot LFD dot 2 dot 11 dot 1501071858580 dot 27020 at eddie dot linux-mips dot org> <54AD8A76 dot 9010702 at redhat dot com> <alpine dot LFD dot 2 dot 11 dot 1501072330430 dot 27020 at eddie dot linux-mips dot org> <20150108211229 dot GA5634 at host2 dot jankratochvil dot net> <1420755123 dot 2630 dot 21 dot camel at ubuntu-sellcey> <54AF1118 dot 2070707 at redhat dot com> <1420762209 dot 2630 dot 27 dot camel at ubuntu-sellcey> <54AF50E4 dot 3080901 at sunrus dot com dot cn> <54AFA92C dot 8010108 at redhat dot com>
On 1/9/15 18:10, Pedro Alves wrote:
> On 01/09/2015 03:54 AM, Chen Gang S wrote:
>>
>> Excuse me, I guess, I can not check in, welcome any other members help to
>> check in for me.
> I was going to apply it as is, but I recalled that the return
> of "system" is really a 'wait' status:
>
>> + if (system (zap))
>> + warning (_("Could not remove temporary directory %s"), dir);
>
> so I tweaked the patch accordingly, and pushed it, as below.
[...]
> - system (zap);
> + wstat = system (zap);
> + if (wstat == -1 || !WIFEXITED (wstat) || WEXITSTATUS (wstat) != 0)
> + warning (_("Could not remove temporary directory %s"), dir);
Oh, really it is. Thanks.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed