]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Check return value from write to prevent warning.
authorDarren Tucker <dtucker@dtucker.net>
Thu, 23 Nov 2023 08:34:57 +0000 (19:34 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 23 Nov 2023 08:34:57 +0000 (19:34 +1100)
... and since we're testing for flags with -Werror, this caused
configure to mis-detect compiler flags.

m4/openssh.m4

index 80254a302da86d96e6c58ec44d79572a32d3c8e7..3aed247ea724d866aa318417834eb2644d0cb485 100644 (file)
@@ -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