logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0001-sndiod-Fix-build-without-DEBUG.patch (1334B)


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