diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch b/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch new file mode 100644 index 0000000000..29c20c010f --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From f771407d3e0288ca0c06a894194d3ddad69b9a8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 20 Feb 2015 05:17:05 +0000 | ||
4 | Subject: [PATCH 07/11] util: Use mkostemp only if libc supports it | ||
5 | |||
6 | Upstream-Status: Denied [no desire for uclibc support] | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | src/shared/util.c | 8 ++++++++ | ||
11 | 1 file changed, 8 insertions(+) | ||
12 | |||
13 | diff --git a/src/shared/util.c b/src/shared/util.c | ||
14 | index dc65280..72f4665 100644 | ||
15 | --- a/src/shared/util.c | ||
16 | +++ b/src/shared/util.c | ||
17 | @@ -97,6 +97,8 @@ | ||
18 | #include "def.h" | ||
19 | #include "sparse-endian.h" | ||
20 | |||
21 | +#include "config.h" | ||
22 | + | ||
23 | int saved_argc = 0; | ||
24 | char **saved_argv = NULL; | ||
25 | |||
26 | @@ -6682,7 +6684,13 @@ int mkostemp_safe(char *pattern, int flags) { | ||
27 | |||
28 | u = umask(077); | ||
29 | |||
30 | +#ifdef HAVE_MKOSTEMP | ||
31 | fd = mkostemp(pattern, flags); | ||
32 | +#else | ||
33 | + fd = mkstemp(pattern); | ||
34 | + if (fd >= 0) fcntl(fd, F_SETFD, flags); | ||
35 | +#endif /* HAVE_MKOSTEMP */ | ||
36 | + | ||
37 | if (fd < 0) | ||
38 | return -errno; | ||
39 | |||
40 | -- | ||
41 | 2.1.4 | ||
42 | |||