0001-fix-O_CLOEXEC.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From b39a62f6682463bcd47480348fac3dcd209a19a5 Mon Sep 17 00:00:00 2001
  2. From: Robert Yang <liezhi.yang@windriver.com>
  3. Date: Wed, 22 Jan 2014 01:06:40 -0500
  4. Subject: [PATCH] Add dummy definition of O_CLOEXEC
  5. O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
  6. it, we need check before use.
  7. This patch is much more like a workaround, since it may need fcntl() use
  8. FD_CLOEXEC to replace.
  9. This problem was reported by "Ting Liu <b28495@freescale.com>"
  10. [Thomas De Schampheleire <thomas.de.schampheleire@gmail.com:
  11. - move dummy definition from libkmod-internal.h to missing.h
  12. - update commit title]
  13. [Vicente: Adapt this patch to version 19.]
  14. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
  15. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  16. Upstream-status: rejected, suggests to add in buildroot instead [1]
  17. [1] http://news.gmane.org/find-root.php?message_id=1412062906%2d27378%2d1%2dgit%2dsend%2demail%2dpatrickdepinguin%40gmail.com
  18. ---
  19. shared/missing.h | 4 ++++
  20. 1 files changed, 4 insertions(+), 0 deletions(-)
  21. diff --git a/shared/missing.h b/shared/missing.h
  22. index 4c0d136..e123e98 100644
  23. --- a/shared/missing.h
  24. +++ b/shared/missing.h
  25. @@ -19,6 +19,10 @@
  26. # define __NR_finit_module -1
  27. #endif
  28. +#ifndef O_CLOEXEC
  29. +#define O_CLOEXEC 0
  30. +#endif
  31. +
  32. #ifndef HAVE_FINIT_MODULE
  33. #include <errno.h>
  34. --
  35. 1.7.1