[openssh-commits] [openssh] 01/03: Check return value from write to prevent warning.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Nov 23 19:42:26 AEDT 2023


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 670f5a647e98b6fd95ad64f789f87ee3274b481b
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Thu Nov 23 19:34:57 2023 +1100

    Check return value from write to prevent warning.
    
    ... and since we're testing for flags with -Werror, this caused
    configure to mis-detect compiler flags.
---
 m4/openssh.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/openssh.m4 b/m4/openssh.m4
index 80254a30..3aed247e 100644
--- a/m4/openssh.m4
+++ b/m4/openssh.m4
@@ -20,7 +20,7 @@ int main(int argc, char **argv) {
 	long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
 	f(0);
 	snprintf(b, sizeof b, "%d %d %d %f %f %lld %lld\n", i,j,k,l,m,n,o);
-	write(1, b, 0);
+	if (write(1, b, 0) == -1) exit(0);
 	/*
 	 * Test fallthrough behaviour.  clang 10's -Wimplicit-fallthrough does
 	 * not understand comments and we don't use the "fallthrough" attribute

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list