From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IUkAazhv; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id BF68E5A0280 for ; Fri, 30 May 2025 12:00:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1748599228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v0X1hPyDHzQH7A4ZZFHW5c1wX911DQy9JH2DSU25hI0=; b=IUkAazhvUGe1+3oG/mwzzqybC0SH57NiLuuzodbn5bLNUrpRxEyLrnHY6+joc0B8LlWGJc T9VHxa1I5ApeRVhzWMK8covq16bXRMK1E0GTua4VXAwmVydkBFRBwFQOEm3KSZo5xEcik8 LwaqBwFJXzDHfTF2ATa78OByjjJhNEI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-1c7QFCjmMWajbH7w1Om2vA-1; Fri, 30 May 2025 06:00:27 -0400 X-MC-Unique: 1c7QFCjmMWajbH7w1Om2vA-1 X-Mimecast-MFC-AGG-ID: 1c7QFCjmMWajbH7w1Om2vA_1748599225 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3a4f8192e2cso313777f8f.3 for ; Fri, 30 May 2025 03:00:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748599225; x=1749204025; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v0X1hPyDHzQH7A4ZZFHW5c1wX911DQy9JH2DSU25hI0=; b=YvJTm85POARau8SzL4hviFzNLC6P2YgVea3207qmD05toom1m+mTR1D2fl94GPYl53 NGnlUrmJGcpbYc9ZtRdjqzMxlQsttbhn0H22Q8Nxwn3E4VxX1jb5A7Sl19BHcxvps7lM ti1fXFZBKGxLQ8Dha5OoHZOt/7YZYsLv8r/jOjpNz5F9r6isgU2yAi948cOyhUlPj41A u9adVi/LgKYhwe1WmkEYzBbNFjtXGsR3mqFU2fmNdhW4liA4YAKlsmn4DZt5bczpMY2C l27a/rtSWN02nkSqSmO3Pik1Ab9seeUC0hUJeszlE82Ub2kdOFaLYwB2IUO9dkIRzSQb f2EA== X-Forwarded-Encrypted: i=1; AJvYcCUrP4w6jlTefBX5+XqwFvLJYtpsTmrHaR0UQvaDYu3ctaGumL1vchJpgoNSPGrvUx0f9Dnh6dCl4xk=@passt.top X-Gm-Message-State: AOJu0YwNQ696tyGMutB2sjEavGZHKxFJdOXaTd/hbyZqbyFIqTZWWur4 kR/ofWwIlXmzyFB07YxnJhGaxsY2k0d8y7smyXSwQLX9Y2DuaF0XV0xm9UdIH1NYNCgtt4nseA8 jw7fJT68/4RxKwj5g3KAQMcxzITCps2lWP7x5qs6vym/JvC8ZwjYnWQ== X-Gm-Gg: ASbGncua6YX/kZipd53t8wgb3NdQaK79mFtyemuQ3of8YDluaxerysO1MuPU7gKZ5O8 qJ9ptu5YojA7oNMLSMHL2d7/K91XZKNcvrGA5ZSY98rTjRIBiHyUm+oYl1Yjc7XqP4cyfoVyogl xiCFfVadi/paFQVX0UcEzTWGCqRjnysx+RV34qmurMJjeKRqGYLBVzW4dPPbkMzMlpnGCR8sbpH r22T1Kd7lq/g0Ro9qarr360Xv5yb5hGdpOIur6fL226ltibk1vZkyzGOOUiEYqFs9bFsHOY3FtK 23f/bku5tH56wsQs X-Received: by 2002:a05:6000:220b:b0:3a4:dfaa:df8c with SMTP id ffacd0b85a97d-3a4f7a3bc3emr2172369f8f.11.1748599225086; Fri, 30 May 2025 03:00:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBxg48K1Q1F7tvjV925umkjE6Xh2TsKMFrRX4vobVCo+ciXfhXOkb807d2KYK7tpymnLhVLQ== X-Received: by 2002:a05:6000:220b:b0:3a4:dfaa:df8c with SMTP id ffacd0b85a97d-3a4f7a3bc3emr2172341f8f.11.1748599224658; Fri, 30 May 2025 03:00:24 -0700 (PDT) Received: from [192.168.188.25] ([80.243.52.136]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4efe2b35dsm4382977f8f.0.2025.05.30.03.00.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 May 2025 03:00:24 -0700 (PDT) Message-ID: <0de3e845-0c11-4910-aa37-1392cc449447@redhat.com> Date: Fri, 30 May 2025 12:00:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: conf: flush stdout before early exit To: Jon Maloy , sbrivio@redhat.com, dgibson@redhat.com, passt-dev@passt.top References: <20250529170858.185281-1-jmaloy@redhat.com> From: Paul Holzinger In-Reply-To: <20250529170858.185281-1-jmaloy@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EfJe2Vt0QxpoAhdzRlyT3N2HbwLD5eVr7aOHXHKo0Is_1748599225 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: 2CGPAMOZSFZ3RYBMC6JQONSUEMCTOH2L X-Message-ID-Hash: 2CGPAMOZSFZ3RYBMC6JQONSUEMCTOH2L X-MailFrom: pholzing@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi, On 29/05/2025 19:08, Jon Maloy wrote: > Before doing an early exit any contents of stdout is normally flushed. > This doesn't happen when the output goes into a pipe and we return with > _exit(). We now add an explicit flush in such cases. > > Fixes: d0006fa784a7 ("treewide: use _exit() over exit()") > > Signed-off-by: Jon Maloy Reviewed-by: Paul Holzinger Interestingly enough I never noticed that I broke podman info with this: podman info --format "{{.Host.Pasta.Version}}" The output is empty currently due this issue and works with this patch again. > --- > conf.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/conf.c b/conf.c > index a6d7e22..a1d55a3 100644 > --- a/conf.c > +++ b/conf.c > @@ -975,6 +975,7 @@ static void usage(const char *name, FILE *f, int status) > " SPEC is as described for TCP above\n" > " default: none\n"); > > + fflush(f); > _exit(status); > > pasta_opts: > @@ -1029,6 +1030,7 @@ pasta_opts: > " --ns-mac-addr ADDR Set MAC address on tap interface\n" > " --no-splice Disable inbound socket splicing\n"); > > + fflush(f); > _exit(status); > } > > @@ -1594,6 +1596,7 @@ void conf(struct ctx *c, int argc, char **argv) > FPRINTF(stdout, > c->mode == MODE_PASTA ? "pasta " : "passt "); > FPRINTF(stdout, VERSION_BLOB); > + fflush(stdout); > _exit(EXIT_SUCCESS); > case 15: > ret = snprintf(c->ip4.ifname_out, -- Paul Holzinger