From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 40DBB43EB5 for ; Tue, 16 Aug 2022 23:31:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EA57168B67D; Wed, 17 Aug 2022 02:31:47 +0300 (EEST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6052B68B67D for ; Wed, 17 Aug 2022 02:31:41 +0300 (EEST) Received: by mail-wr1-f44.google.com with SMTP id h24so278343wrb.8 for ; Tue, 16 Aug 2022 16:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc; bh=FXo8acKKZVNFTL8HksJLCVT1qzS2Wzcus7JaLP17iyA=; b=MVEzpgcQpOGyPMTiNmxUQ8Py9v5vJ84E/J+d2Hb6fByQIm4f635gcpptJI0ao1Yevh lPVRxI6hyknum//43uj5k+e0d416LRw9wRp9xIoT8QzJPjEHs6bYtFsLDgala1Gd6fj4 lG4QDDfKsPOvsnIVyUWIvvP5W2Wxe2g2YCfOXxCcwtSA4V6a8WM49uhkue7oxpCGGp0d 800qI0rF/iepcOoK6zfy3jaN+lobyKTmDBTcaWua5vHFFKxCnjHeMaxeKZYMdBkFteIc 0OvuKmPA0zovchbtVzZYqtaJhL+w6bt73qCMUxlvB4WoM/B8+RNlQU3qQOCPXAN7+Uk6 9s4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc; bh=FXo8acKKZVNFTL8HksJLCVT1qzS2Wzcus7JaLP17iyA=; b=MzK264FCvq9kyOIcRjX75AodA8pWvO+fqhzEObe1+VNdp04ZigXyW9/mPwIQRXJ9LD jcAYbWgG70wFCw8Sy61fKJi7CRq2wEsEihDixTi4CZR4ulKac189+qpx/++Dm4oGGQpi xBYfIPE9XL6rPeadiTcdRpOUiFE5PlYscx/OdJi0ODN7ZnarFL8kWTAlWUML9ezDF0Pi AA5kV32tMlZ95eJkuEJp6rUkYXVz0re9hPRXRs6CFNQmD3JGTy/5Le+5Qzo220PxA0M7 PLw4veURvZ0m+UwsBywfSBg4vyrVWe8kzxdbkhP2Zc7is5wSDK/JX7zf0myDehOPDtJS WwwQ== X-Gm-Message-State: ACgBeo2m6TXzOh6+vbeWGPKTdcJlQYTnk2W8xFc2lVSvDXMgOfoqyo4V bMt4CG8OqoYMxtd1R97U6FfqpmLCVwaOZg== X-Google-Smtp-Source: AA6agR5BfzonPzsewPeOSXMK0YyoaIi9ZYzA1Aiijww+S1c1YgOXIiD8x0/oHuupzzdyQiZNL/mTjg== X-Received: by 2002:a5d:64e1:0:b0:225:1635:8fef with SMTP id g1-20020a5d64e1000000b0022516358fefmr3149812wri.481.1660692700460; Tue, 16 Aug 2022 16:31:40 -0700 (PDT) Received: from mariano (94-37-135-74.adsl-ull.clienti.tiscali.it. [94.37.135.74]) by smtp.gmail.com with ESMTPSA id ba11-20020a0560001c0b00b002235eb9d200sm11698432wrb.10.2022.08.16.16.31.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 16:31:39 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 33DDBC071F; Wed, 17 Aug 2022 01:31:38 +0200 (CEST) Date: Wed, 17 Aug 2022 01:31:38 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: <20220816233138.GC3168@mariano> Mail-Followup-To: FFmpeg development discussions and patches References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.13.2 (2019-12-18) Subject: Re: [FFmpeg-devel] Patch: fftools/ffprobe.c: avoid overriding error code. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Similar approach as: [FFmpeg-devel] [PATCH] ffprobe: restore reporting error code for failed inputs On date Monday 2022-07-18 20:40:03 +0000, Yubo Xie wrote: > From 7c28459fa1e8d0a375a239257601bb4e47460053 Mon Sep 17 00:00:00 2001 > From: xyb > Date: Mon, 18 Jul 2022 13:31:51 -0700 > Subject: [PATCH] [fftools/ffprobe.c] avoid overriding error code. > > --- > fftools/ffprobe.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c > index f156663019..cdd62de696 100644 > --- a/fftools/ffprobe.c > +++ b/fftools/ffprobe.c > @@ -4026,7 +4026,7 @@ int main(int argc, char **argv) > WriterContext *wctx; > char *buf; > char *w_name = NULL, *w_args = NULL; > - int ret, i; > + int ret, i, ret2 = 0; > > init_dynload(); > > @@ -4151,8 +4151,8 @@ int main(int argc, char **argv) > } > > writer_print_section_footer(wctx); > - ret = writer_close(&wctx); > - if (ret < 0) > + ret2 = writer_close(&wctx); > + if (ret2 < 0) > av_log(NULL, AV_LOG_ERROR, "Writing output failed: %s\n", av_err2str(ret)); ret2 > } > > @@ -4167,5 +4167,5 @@ end: > > avformat_network_deinit(); > > - return ret < 0; > + return ret < 0 || ret2 < 0; LGTM otherwise (it's probably better if we just return 1 in case of failure, no need to propagate the negative error code from the main routine). _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".