The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / util-linux / 0003-c.h-define-mkostemp-for-older-version-of-uClibc.patch
1 From 42a84250fc78bae3e885ecd1379e713663fe6487 Mon Sep 17 00:00:00 2001
2 From: Romain Naour <romain.naour@openwide.fr>
3 Date: Sun, 6 Apr 2014 12:12:41 +0200
4 Subject: [PATCH 1/1] c.h: define mkostemp for older version of uClibc
5
6 Signed-off-by: Romain Naour <romain.naour@openwide.fr>
7 ---
8  configure.ac |  2 ++
9  include/c.h  | 14 ++++++++++++++
10  2 files changed, 16 insertions(+)
11
12 diff --git a/configure.ac b/configure.ac
13 index 35a1f26..a9b8d34 100644
14 --- a/configure.ac
15 +++ b/configure.ac
16 @@ -321,6 +321,8 @@ AC_CHECK_FUNCS([ \
17  ])
18  AC_FUNC_FSEEKO
19  
20 +AC_CHECK_FUNCS([mkostemp])
21 +
22  AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
23  AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
24  
25 diff --git a/include/c.h b/include/c.h
26 index 4a9bf3d..1b880ed 100644
27 --- a/include/c.h
28 +++ b/include/c.h
29 @@ -300,4 +300,18 @@ static inline int usleep(useconds_t usec)
30  # define SEEK_HOLE     4
31  #endif
32  
33 +/*
34 + * mkostemp() may be missing with older version of uClibc
35 + */
36 +#ifndef HAVE_MKOSTEMP
37 +static inline int mkostemp(char *template, int flags)
38 +{
39 +       int fd;
40 +       fd = mkstemp(template);
41 +       if (flags & O_CLOEXEC && fd >= 0)
42 +               fcntl(fd, F_SETFD, FD_CLOEXEC);
43 +       return fd;
44 +}
45 +#endif
46 +
47  #endif /* UTIL_LINUX_C_H */
48 -- 
49 1.9.0
50