Print the strerror of the expected error. errno is not valid here since
authorclaudio <claudio@openbsd.org>
Sun, 10 Apr 2022 14:08:35 +0000 (14:08 +0000)
committerclaudio <claudio@openbsd.org>
Sun, 10 Apr 2022 14:08:35 +0000 (14:08 +0000)
bind(2) succeeded.

regress/sys/netinet/in_pcbbind/runtest.c

index 2842a2c..c971566 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: runtest.c,v 1.6 2020/12/30 18:56:56 benno Exp $ */
+/* $OpenBSD: runtest.c,v 1.7 2022/04/10 14:08:35 claudio Exp $ */
 /*
  * Copyright (c) 2015 Vincent Gross <vincent.gross@kilob.yt>
  *
@@ -99,7 +99,7 @@ runtest(int *sockp, struct addrinfo *ai, int reuseaddr, int reuseport,
        if (error == 0 && expected != 0) {
                warnx("bind(%s,%s,%s) succeeded, expected : %s", ai->ai_canonname,
                    reuseaddr ? "REUSEADDR" : "", reuseport ? "REUSEPORT" : "",
-                   strerror(errno));
+                   strerror(expected));
                return (1);
        }