summaryrefslogtreecommitdiff
path: root/libc/pwd_grp/getpwnam_r.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2015-12-22 10:58:08 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-12-22 14:32:50 +0100
commitf5bdd8ff82607e55a1c511e13e37a984408c8094 (patch)
tree0cf1c8860142eea988339e952fc4271b88e7b5b4 /libc/pwd_grp/getpwnam_r.c
parent2a3ffa836a3a9f94f19ee2671f41c1851221a105 (diff)
libc/pwd_grp: Create template for non-reentrant functions
Avoid a lot of copy'n'paste code, no functionality change Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Diffstat (limited to 'libc/pwd_grp/getpwnam_r.c')
-rw-r--r--libc/pwd_grp/getpwnam_r.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libc/pwd_grp/getpwnam_r.c b/libc/pwd_grp/getpwnam_r.c
index a4440e756..bc5e3d5cf 100644
--- a/libc/pwd_grp/getpwnam_r.c
+++ b/libc/pwd_grp/getpwnam_r.c
@@ -4,5 +4,10 @@
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-#define L_getpwnam_r
+#define GETXXKEY_R_FUNC getpwnam_r
+#define GETXXKEY_R_PARSER __parsepwent
+#define GETXXKEY_R_ENTTYPE struct passwd
+#define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->pw_name, key))
+#define DO_GETXXKEY_R_KEYTYPE const char *__restrict
+#define DO_GETXXKEY_R_PATHNAME _PATH_PASSWD
#include "pwd_grp.c"