From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 0440D5A004F for ; Fri, 21 Jun 2024 03:11:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1718932309; bh=fkdCmubSK5u4xthXYBor3MldoySCbBg9sPKZ9OCLufg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K9KWvcLMHSAthfeNYqEV0m/gErfd0Xu2CipKiHX0PjKjUWQx8li5pNKghZLdXjy8j xK3++4AJ0axbB8gouexctz1ODQKszDyCAKmDDlWCvRGh5e9QWJAcvtiVWQxblHrTFv zHBjEwvgmYZ5f9lTgbAOX06pstkIU3u0+NQJuRFuQaY8Xj9GKPdPyurWpIe8XLMe1t k65lvcIvpqCKsDZTNDxNutDMkbFJQHEmt5P8zlftkBWs9R6jNt/ZGkompiCuJapQ4Q 2+prNYwyKSqDos0D1ZFJ4PnLOU5rZNsEgmbZLGBQZ4PV6bklYl/Oc7KX+UI9KFejDO 7kEBL55VsYTGA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4W4zpY4fZnz4wcC; Fri, 21 Jun 2024 11:11:49 +1000 (AEST) Date: Fri, 21 Jun 2024 11:11:39 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v5 9/9] log: Don't report syslog failures to stderr after initialisation Message-ID: References: <20240620161518.142285-1-sbrivio@redhat.com> <20240620161518.142285-10-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nyTtq8LBqvlg4zej" Content-Disposition: inline In-Reply-To: <20240620161518.142285-10-sbrivio@redhat.com> Message-ID-Hash: 6Z72GJZMQIYVWAKC2G4OAKBJVQFI265U X-Message-ID-Hash: 6Z72GJZMQIYVWAKC2G4OAKBJVQFI265U X-MailFrom: dgibson@gandalf.ozlabs.org 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 CC: passt-dev@passt.top, Yalan Zhang 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: --nyTtq8LBqvlg4zej Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 20, 2024 at 06:15:18PM +0200, Stefano Brivio wrote: > If we daemonised, we can't use standard error. If we didn't, it's > rather annoying to have all those messages on standard error anyway, > and kind of pointless too, as the messages we wanted to print were > printed to standard error anyway. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > log.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/log.c b/log.c > index a72b871..9ed6bc1 100644 > --- a/log.c > +++ b/log.c > @@ -191,7 +191,7 @@ void passt_vsyslog(int pri, const char *format, va_li= st ap) > if (format[strlen(format)] !=3D '\n') > n +=3D snprintf(buf + n, BUFSIZ - n, "\n"); > =20 > - if (log_sock >=3D 0 && send(log_sock, buf, n, 0) !=3D n) > + if (log_sock >=3D 0 && send(log_sock, buf, n, 0) !=3D n && !log_runtime) > fprintf(stderr, "Failed to send %i bytes to syslog\n", n); > } > =20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --nyTtq8LBqvlg4zej Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZ00zoACgkQzQJF27ox 2GcJVhAAj+3F7BGGtIGFblhlX2KVLg6kxAlELcP1ySRlp6SMW4aelPJIC+QjAB9J ml5cR+wkMYkyn65OQ439z/SuGuEFEWwy6m9fA9HkGOibTjIKgIakbi4ptL/X9g2f V8oQkYV7ao2GmBn5mkBAtCFzeNXp7N/6PzVRZWBXrH/6Bm5ij0ECoQZZmzgp5XNR jSUakt1kgRuLAaUGyPrmkdGm8+X4S2kYTQM8d7Y1Jidmn28d18l9jmMogKdjCcOX mZQkWYoJdhHIeTWLeV0WJaMcCckk4Vsr7g6t8+fccYlphlmB1BM6hjEEUBPvEKju koMjDq10lkf78OstlaYRg1qcSxEGrMQAbJMBn7RKLBG7dDB1gF5HJuTm7BrDuHw4 K7MF/lH6yXL3Wc0XLu/ZzUyQucjIHcURGe4KsdZOJt4rL7qP2rR2tJfIR9ONj8c3 RZ5skxbiMEuzT51gwefluFA/abgdn/5kNNb3RgUqBR4Lo2C8sBoKRgBNFxIX86Om 2Mw9hO7IVt6N5q+hO77geKdbooyEX2LDZgYk2ngvzGGeEbiGbZ0V316v/4R9M7WK pbRFjS+Am1CKjpJpzlZOJfkSf6m8HYXL7BVhO5LQgwUDl6BJSECZQe/ixXdOF0jh kopuZk0eyJvMU97aWH9fbQkLLcTsIVv0hM9dq/AmnUT6RESU8TM= =Msv+ -----END PGP SIGNATURE----- --nyTtq8LBqvlg4zej--