]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: debug/cli: condition test of O_ASYNC to its existence
authorWilly Tarreau <w@1wt.eu>
Tue, 25 Jan 2022 13:51:53 +0000 (14:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 25 Jan 2022 13:51:53 +0000 (14:51 +0100)
David Carlier reported a build breakage on Haiku since commit
5be7c198e ("DEBUG: cli: add a new "debug dev fd" expert command")
due to O_ASYNC not being defined. Ilya also reported it broke the
build on Cygwin. It's not that portable and sometimes defined as
O_NONBLOCK for portability. But here we don't even need that, as
we already condition other flags, let's just ignore it if it does
not exist.

src/debug.c

index c15c92650facd2d01c096ebff013240740f6a8b8..1a69697e7f7fe5e7721a2c1c52df54a630e02e8a 100644 (file)
@@ -1075,7 +1075,9 @@ static int debug_iohandler_fd(struct appctx *appctx)
                                case O_NOCTTY:  chunk_appendf(&trash, ",O_NOCTTY");  break;
                                case O_TRUNC:   chunk_appendf(&trash, ",O_TRUNC");   break;
                                case O_APPEND:  chunk_appendf(&trash, ",O_APPEND");  break;
+#ifdef O_ASYNC
                                case O_ASYNC:   chunk_appendf(&trash, ",O_ASYNC");   break;
+#endif
 #ifdef O_DIRECT
                                case O_DIRECT:  chunk_appendf(&trash, ",O_DIRECT");  break;
 #endif