Mercurial > hg > aboriginal
annotate sources/patches/uClibc-mkostemp.patch @ 1682:64316ca2bc9b
Remove redundant list assignment in ccwrap that screws up ordering and puts the -L entries in the wrong order.
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 05 Sep 2014 23:54:01 -0500 |
parents | 1fbfabb09582 |
children |
rev | line source |
---|---|
1466
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 diff --git a/include/stdlib.h b/include/stdlib.h |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 index e9a8b84..b76078c 100644 |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 --- a/include/stdlib.h |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 +++ b/include/stdlib.h |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 @@ -630,16 +630,21 @@ extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 marked with __THROW. */ |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 # ifndef __USE_FILE_OFFSET64 |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 extern int mkstemp (char *__template) __nonnull ((1)) __wur; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 +extern int mkostemp (char *__template, int __flags) __nonnull ((1)) __wur; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 # else |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 # ifdef __REDIRECT |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 extern int __REDIRECT (mkstemp, (char *__template), mkstemp64) |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 __nonnull ((1)) __wur; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 +extern int __REDIRECT (mkostemp, (char *__template, int __flags), mkostemp64) |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 + __nonnull ((1)) __wur; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 # else |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 # define mkstemp mkstemp64 |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 +# define mkostemp mkostemp64 |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 # endif |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 # endif |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 # ifdef __USE_LARGEFILE64 |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 extern int mkstemp64 (char *__template) __nonnull ((1)) __wur; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 +extern int mkostemp64 (char *__template, int __flags) __nonnull ((1)) __wur; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 # endif |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
25 #endif |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 diff --git a/libc/stdlib/mkstemp.c b/libc/stdlib/mkstemp.c |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 index ce7d7db..68581b8 100644 |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 --- a/libc/stdlib/mkstemp.c |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 +++ b/libc/stdlib/mkstemp.c |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 @@ -25,7 +25,12 @@ |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 The last six characters of TEMPLATE must be "XXXXXX"; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 they are replaced with a string that makes the filename unique. |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 Then open the file and return a fd. */ |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 +int mkostemp (char *template, int flags) |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 +{ |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
37 + return __gen_tempname (template, __GT_FILE, flags); |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
38 +} |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
39 + |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
40 int mkstemp (char *template) |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 { |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
42 - return __gen_tempname (template, __GT_FILE, S_IRUSR | S_IWUSR); |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
43 + return mkostemp(template, S_IRUSR | S_IWUSR); |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
44 } |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
45 diff --git a/libc/stdlib/mkstemp64.c b/libc/stdlib/mkstemp64.c |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
46 index 2cdee70..375c5d3 100644 |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
47 --- a/libc/stdlib/mkstemp64.c |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
48 +++ b/libc/stdlib/mkstemp64.c |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
49 @@ -25,7 +25,12 @@ |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
50 The last six characters of TEMPLATE must be "XXXXXX"; |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
51 they are replaced with a string that makes the filename unique. |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
52 Then open the file and return a fd. */ |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
53 +int mkostemp64 (char *template, int flags) |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
54 +{ |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
55 + return __gen_tempname (template, __GT_BIGFILE, flags); |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
56 +} |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
57 + |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
58 int mkstemp64 (char *template) |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
59 { |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
60 - return __gen_tempname (template, __GT_BIGFILE, S_IRUSR | S_IWUSR); |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
61 + return mkostemp64 (template, S_IRUSR | S_IWUSR); |
1fbfabb09582
Patch to add mkostemp to uClibc, which util-linux needs in LFS 6.8.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
62 } |