logo

oasis

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

0008-Use-alloca-if-VLAs-aren-t-supported.patch (646B)


  1. From 7943a7c1c795a1ffe79b2898eb4860cec60dec23 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Mon, 24 Jun 2019 23:54:21 -0700
  4. Subject: [PATCH] Use alloca if VLAs aren't supported
  5. ---
  6. lib/path.c | 4 ++++
  7. 1 file changed, 4 insertions(+)
  8. diff --git a/lib/path.c b/lib/path.c
  9. index 75fa85305..af90261a6 100644
  10. --- a/lib/path.c
  11. +++ b/lib/path.c
  12. @@ -982,7 +982,11 @@ static int ul_path_cpuparse(struct path_cxt *pc, cpu_set_t **set, int maxcpus, i
  13. {
  14. FILE *f;
  15. size_t setsize, len = maxcpus * 7;
  16. +#ifndef __STDC_NO_VLA__
  17. char buf[len];
  18. +#else
  19. + char *buf = alloca(len);
  20. +#endif
  21. int rc;
  22. *set = NULL;
  23. --
  24. 2.28.0