master hovercats/oakiss / pkg / sndio / patch / 0001-sndiod-Fix-build-without-DEBUG.patch
 1From 4ee56f07ef8be718bb1f24f5b73c440527c93bc9 Mon Sep 17 00:00:00 2001
 2From: Michael Forney <mforney@mforney.org>
 3Date: Thu, 5 Nov 2020 00:28:06 -0800
 4Subject: [PATCH] sndiod: Fix build without DEBUG
 5
 6---
 7 aucat/afile.c   | 4 ++--
 8 sndiod/listen.c | 4 ++++
 9 2 files changed, 6 insertions(+), 2 deletions(-)
10
11diff --git a/aucat/afile.c b/aucat/afile.c
12index b880878..3e400ce 100644
13--- a/aucat/afile.c
14+++ b/aucat/afile.c
15@@ -743,13 +743,13 @@ afile_au_writehdr(struct afile *f)
16 	case 32:
17 		fmt = AU_FMT_PCM32;
18 		break;
19-#ifdef DEBUG
20 	default:
21+#ifdef DEBUG
22 		log_puts(f->path);
23 		log_puts(": wrong precision\n");
24 		panic();
25-		return 0;
26 #endif
27+		return 0;
28 	}
29 	be32_set(&hdr.fmt, fmt);
30 	be32_set(&hdr.rate, f->rate);
31diff --git a/sndiod/listen.c b/sndiod/listen.c
32index 54c9684..c87f600 100644
33--- a/sndiod/listen.c
34+++ b/sndiod/listen.c
35@@ -254,16 +254,20 @@ listen_in(void *arg)
36 		return;
37 	}
38 	if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1) {
39+#ifdef DEBUG
40 		file_log(f->file);
41 		log_puts(": failed to set non-blocking mode\n");
42+#endif
43 		goto bad_close;
44 	}
45 	if (f->path == NULL) {
46 		opt = 1;
47 		if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
48 		    &opt, sizeof(int)) == -1) {
49+#ifdef DEBUG
50 			file_log(f->file);
51 			log_puts(": failed to set TCP_NODELAY flag\n");
52+#endif
53 			goto bad_close;
54 		}
55 	}
56-- 
572.29.2
58