From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106986 invoked by alias); 18 Jun 2018 03:16:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 106966 invoked by uid 89); 18 Jun 2018 03:16:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Who X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Jun 2018 03:16:33 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3294A1E529; Sun, 17 Jun 2018 23:16:31 -0400 (EDT) Subject: Re: [RFA] Remove cleanups from ser-mingw.c To: Tom Tromey , gdb-patches@sourceware.org References: <20180614212047.14265-1-tom@tromey.com> From: Simon Marchi Message-ID: Date: Mon, 18 Jun 2018 03:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180614212047.14265-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-06/txt/msg00436.txt.bz2 Hi Tom, LGTM, with some nits. On 2018-06-14 05:20 PM, Tom Tromey wrote: > @@ -914,14 +913,12 @@ pipe_windows_open (struct serial *scb, const char *name) > goto fail; > scb->error_fd = fileno (pex_stderr); > > - scb->state = (void *) ps; > + scb->state = (void *) ps.release (); - I think we could remove the cast, unless you think it helps readability. - I think we could remove the goto fail mechanism now. > > argv.release (); Side note: doesn't this argv.release() look fishy to you? Who ends up owning it? Simon