summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch')
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch319
1 files changed, 319 insertions, 0 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch
new file mode 100644
index 0000000000..4ac765c334
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch
@@ -0,0 +1,319 @@
1Upstream-Status: Pending
2
3From 096abf14d2dc978607ccd8a0d7f42da65d8991f3 Mon Sep 17 00:00:00 2001
4From: Khem Raj <raj.khem@gmail.com>
5Date: Sun, 9 Sep 2012 22:00:04 -0700
6Subject: [PATCH] Revert "utent.c, wtent.c: move functions from utxent.c"
7
8This reverts commit 84135275cfeebc0b233c1c96eeada4d4178a0b18.
9---
10 include/utmp.h | 8 +++++
11 libc/misc/utmp/utent.c | 80 +++++++++++------------------------------------
12 libc/misc/utmp/utxent.c | 4 +--
13 libc/misc/utmp/wtent.c | 14 ++-------
14 4 files changed, 30 insertions(+), 76 deletions(-)
15
16Index: git/include/utmp.h
17===================================================================
18--- git.orig/include/utmp.h 2013-01-21 16:37:18.000000000 -0800
19+++ git/include/utmp.h 2013-01-21 16:40:56.987583099 -0800
20@@ -56,30 +56,37 @@
21 /* Append entry UTMP to the wtmp-like file WTMP_FILE. */
22 extern void updwtmp (const char *__wtmp_file, const struct utmp *__utmp)
23 __THROW;
24+libc_hidden_proto(updwtmp)
25
26 /* Change name of the utmp file to be examined. */
27 extern int utmpname (const char *__file) __THROW;
28+libc_hidden_proto(utmpname)
29
30 /* Read next entry from a utmp-like file. */
31 extern struct utmp *getutent (void) __THROW;
32+libc_hidden_proto(getutent)
33
34 /* Reset the input stream to the beginning of the file. */
35 extern void setutent (void) __THROW;
36+libc_hidden_proto(setutent)
37
38 /* Close the current open file. */
39 extern void endutent (void) __THROW;
40+libc_hidden_proto(endutent)
41
42 /* Search forward from the current point in the utmp file until the
43 next entry with a ut_type matching ID->ut_type. */
44 extern struct utmp *getutid (const struct utmp *__id) __THROW;
45+libc_hidden_proto(getutid)
46
47 /* Search forward from the current point in the utmp file until the
48 next entry with a ut_line matching LINE->ut_line. */
49 extern struct utmp *getutline (const struct utmp *__line) __THROW;
50+libc_hidden_proto(getutline)
51
52 /* Write out entry pointed to by UTMP_PTR into the utmp file. */
53 extern struct utmp *pututline (const struct utmp *__utmp_ptr) __THROW;
54-
55+libc_hidden_proto(pututline)
56
57 #if 0 /* def __USE_MISC */
58 /* Reentrant versions of the file for handling utmp files. */
59Index: git/libc/misc/utmp/utent.c
60===================================================================
61--- git.orig/libc/misc/utmp/utent.c 2013-01-21 16:37:18.000000000 -0800
62+++ git/libc/misc/utmp/utent.c 2013-01-21 16:38:14.035578638 -0800
63@@ -19,9 +19,6 @@
64 #include <errno.h>
65 #include <string.h>
66 #include <utmp.h>
67-#ifdef __UCLIBC_HAS_UTMPX__
68-# include <utmpx.h>
69-#endif
70 #include <not-cancel.h>
71
72 #include <bits/uClibc_mutex.h>
73@@ -34,7 +31,7 @@
74 static const char *static_ut_name = default_file_name;
75
76 /* This function must be called with the LOCK held */
77-static void __setutent_unlocked(void)
78+static void __setutent(void)
79 {
80 if (static_fd < 0) {
81 static_fd = open_not_cancel_2(static_ut_name, O_RDWR | O_CLOEXEC);
82@@ -53,24 +50,19 @@
83 lseek(static_fd, 0, SEEK_SET);
84 }
85 #if defined __UCLIBC_HAS_THREADS__
86-static void __setutent(void)
87+void setutent(void)
88 {
89 __UCLIBC_MUTEX_LOCK(utmplock);
90- __setutent_unlocked();
91+ __setutent();
92 __UCLIBC_MUTEX_UNLOCK(utmplock);
93 }
94 #else
95-static void __setutent(void);
96-strong_alias(__setutent_unlocked,__setutent)
97-#endif
98 strong_alias(__setutent,setutent)
99-
100-#ifdef __UCLIBC_HAS_UTMPX__
101-strong_alias(__setutent,setutxent)
102 #endif
103+libc_hidden_def(setutent)
104
105 /* This function must be called with the LOCK held */
106-static struct utmp *__getutent_unlocked(void)
107+static struct utmp *__getutent(void)
108 {
109 if (static_fd < 0) {
110 __setutent();
111@@ -86,27 +78,19 @@
112 return NULL;
113 }
114 #if defined __UCLIBC_HAS_THREADS__
115-static struct utmp *__getutent(void)
116+struct utmp *getutent(void)
117 {
118 struct utmp *ret;
119
120 __UCLIBC_MUTEX_LOCK(utmplock);
121- ret = __getutent_unlocked();
122+ ret = __getutent();
123 __UCLIBC_MUTEX_UNLOCK(utmplock);
124 return ret;
125 }
126 #else
127-static struct utmp *__getutent(void);
128-strong_alias(__getutent_unlocked,__getutent)
129-#endif
130 strong_alias(__getutent,getutent)
131-
132-#ifdef __UCLIBC_HAS_UTMPX__
133-struct utmpx *getutxent(void)
134-{
135- return (struct utmpx *) __getutent ();
136-}
137 #endif
138+libc_hidden_def(getutent)
139
140 static void __endutent(void)
141 {
142@@ -117,13 +101,10 @@
143 __UCLIBC_MUTEX_UNLOCK(utmplock);
144 }
145 strong_alias(__endutent,endutent)
146-
147-#ifdef __UCLIBC_HAS_UTMPX__
148-strong_alias(__endutent,endutxent)
149-#endif
150+libc_hidden_def(endutent)
151
152 /* This function must be called with the LOCK held */
153-static struct utmp *__getutid_unlocked(const struct utmp *utmp_entry)
154+static struct utmp *__getutid(const struct utmp *utmp_entry)
155 {
156 struct utmp *lutmp;
157 unsigned type;
158@@ -133,7 +114,7 @@
159 type = utmp_entry->ut_type - 1;
160 type /= 4;
161
162- while ((lutmp = __getutent_unlocked()) != NULL) {
163+ while ((lutmp = __getutent()) != NULL) {
164 if (type == 0 && lutmp->ut_type == utmp_entry->ut_type) {
165 /* one of RUN_LVL, BOOT_TIME, NEW_TIME, OLD_TIME */
166 return lutmp;
167@@ -147,34 +128,26 @@
168 return NULL;
169 }
170 #if defined __UCLIBC_HAS_THREADS__
171-static struct utmp *__getutid(const struct utmp *utmp_entry)
172+struct utmp *getutid(const struct utmp *utmp_entry)
173 {
174 struct utmp *ret;
175
176 __UCLIBC_MUTEX_LOCK(utmplock);
177- ret = __getutid_unlocked(utmp_entry);
178+ ret = __getutid(utmp_entry);
179 __UCLIBC_MUTEX_UNLOCK(utmplock);
180 return ret;
181 }
182 #else
183-static struct utmp *__getutid(const struct utmp *utmp_entry);
184-strong_alias(__getutid_unlocked,__getutid)
185-#endif
186 strong_alias(__getutid,getutid)
187-
188-#ifdef __UCLIBC_HAS_UTMPX__
189-struct utmpx *getutxid(const struct utmpx *utmp_entry)
190-{
191- return (struct utmpx *) __getutid ((const struct utmp *) utmp_entry);
192-}
193 #endif
194+libc_hidden_def(getutid)
195
196 static struct utmp *__getutline(const struct utmp *utmp_entry)
197 {
198 struct utmp *lutmp;
199
200 __UCLIBC_MUTEX_LOCK(utmplock);
201- while ((lutmp = __getutent_unlocked()) != NULL) {
202+ while ((lutmp = __getutent()) != NULL) {
203 if (lutmp->ut_type == USER_PROCESS || lutmp->ut_type == LOGIN_PROCESS) {
204 if (strncmp(lutmp->ut_line, utmp_entry->ut_line, sizeof(lutmp->ut_line)) == 0) {
205 break;
206@@ -185,13 +158,7 @@
207 return lutmp;
208 }
209 strong_alias(__getutline,getutline)
210-
211-#ifdef __UCLIBC_HAS_UTMPX__
212-struct utmpx *getutxline(const struct utmpx *utmp_entry)
213-{
214- return (struct utmpx *) __getutline ((const struct utmp *) utmp_entry);
215-}
216-#endif
217+libc_hidden_def(getutline)
218
219 static struct utmp *__pututline(const struct utmp *utmp_entry)
220 {
221@@ -200,7 +167,7 @@
222 the file pointer where they want it, everything will work out. */
223 lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
224
225- if (__getutid_unlocked(utmp_entry) != NULL)
226+ if (__getutid(utmp_entry) != NULL)
227 lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
228 else
229 lseek(static_fd, (off_t) 0, SEEK_END);
230@@ -211,13 +178,7 @@
231 return (struct utmp *)utmp_entry;
232 }
233 strong_alias(__pututline,pututline)
234-
235-#ifdef __UCLIBC_HAS_UTMPX__
236-struct utmpx *pututxline (const struct utmpx *utmp_entry)
237-{
238- return (struct utmpx *) __pututline ((const struct utmp *) utmp_entry);
239-}
240-#endif
241+libc_hidden_def(pututline)
242
243 static int __utmpname(const char *new_ut_name)
244 {
245@@ -241,7 +202,4 @@
246 return 0; /* or maybe return -(static_ut_name != new_ut_name)? */
247 }
248 strong_alias(__utmpname,utmpname)
249-
250-#ifdef __UCLIBC_HAS_UTMPX__
251-strong_alias(__utmpname,utmpxname)
252-#endif
253+libc_hidden_def(utmpname)
254Index: git/libc/misc/utmp/utxent.c
255===================================================================
256--- git.orig/libc/misc/utmp/utxent.c 2013-01-21 16:37:18.000000000 -0800
257+++ git/libc/misc/utmp/utxent.c 2013-01-21 16:38:14.035578638 -0800
258@@ -13,7 +13,6 @@
259 #include <utmpx.h>
260 #include <utmp.h>
261
262-#if 0 /* moved to utent.c */
263 void setutxent(void)
264 {
265 setutent ();
266@@ -49,12 +48,10 @@
267 return utmpname (new_ut_name);
268 }
269
270-/* moved to wtent.c */
271 void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
272 {
273 updwtmp (wtmpx_file, (const struct utmp *) utmpx);
274 }
275-#endif
276
277 /* Copy the information in UTMPX to UTMP. */
278 void getutmp (const struct utmpx *utmpx, struct utmp *utmp)
279@@ -107,3 +104,4 @@
280 utmpx->ut_time = utmp->ut_time;
281 #endif
282 }
283+
284Index: git/libc/misc/utmp/wtent.c
285===================================================================
286--- git.orig/libc/misc/utmp/wtent.c 2013-01-21 16:37:18.000000000 -0800
287+++ git/libc/misc/utmp/wtent.c 2013-01-21 16:38:14.035578638 -0800
288@@ -11,9 +11,6 @@
289 #include <time.h>
290 #include <unistd.h>
291 #include <utmp.h>
292-#ifdef __UCLIBC_HAS_UTMPX__
293-# include <utmpx.h>
294-#endif
295 #include <fcntl.h>
296 #include <sys/file.h>
297 #include <not-cancel.h>
298@@ -36,7 +33,7 @@
299 }
300 #endif
301
302-static void __updwtmp(const char *wtmp_file, const struct utmp *lutmp)
303+void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
304 {
305 int fd;
306
307@@ -49,11 +46,4 @@
308 }
309 }
310 }
311-strong_alias(__updwtmp,updwtmp)
312-
313-#ifdef __UCLIBC_HAS_UTMPX__
314-void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
315-{
316- __updwtmp (wtmpx_file, (const struct utmp *) utmpx);
317-}
318-#endif
319+libc_hidden_def(updwtmp)