002-mkostemp.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Support older hosts with latest util-linux-native
  2. mkostemp is not defined on older machines. So we detect this and
  3. provide a define that uses mkstemp instead.
  4. O_CLOEXEC is not defined on older machines. It is however defined
  5. in the 'c.h' header. Fix up the users to include 'c.h'.
  6. fdisks/fdisksunlabel.c was modified to use qsort_r, however
  7. this is not defined on older hosts. Revert:
  8. commit c69bbca9c1f6645097bd20fe3a21f5a99a2a0698
  9. fdisk: (sun): use ask API, remove global variable
  10. Upstream-Status: Inappropriate [other]
  11. Patches revert upstream changes in order to support older
  12. machines.
  13. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
  14. ---
  15. --- a/configure.ac
  16. +++ b/configure.ac
  17. @@ -315,6 +315,7 @@ AC_CHECK_FUNCS([ \
  18. llseek \
  19. lseek64 \
  20. mempcpy \
  21. + mkostemp \
  22. nanosleep \
  23. open_memstream \
  24. personality \
  25. --- a/include/c.h
  26. +++ b/include/c.h
  27. @@ -233,6 +233,13 @@ static inline int dirfd(DIR *d)
  28. #endif
  29. /*
  30. + * mkostemp replacement
  31. + */
  32. +#ifndef HAVE_MKOSTEMP
  33. +#define mkostemp(template, flags) mkstemp(template)
  34. +#endif
  35. +
  36. +/*
  37. * MAXHOSTNAMELEN replacement
  38. */
  39. static inline size_t get_hostname_max(void)