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