summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTito Ragusa <farmatito@tiscali.it>2015-02-19 21:02:59 (GMT)
committerDenys Vlasenko <vda.linux@googlemail.com>2015-02-19 21:03:56 (GMT)
commitcb6a112f09c3b5dfe94b5c365ca50df4dcc05520 (patch)
tree726f543a539dd917ab8e6e97c17ad8c4ff6c5eb0
parentd7bfee1edb551d3503c7b616702a73192ba069a9 (diff)
downloadbusybox-cb6a112f09c3b5dfe94b5c365ca50df4dcc05520.zip
busybox-cb6a112f09c3b5dfe94b5c365ca50df4dcc05520.tar.gz
busybox-cb6a112f09c3b5dfe94b5c365ca50df4dcc05520.tar.bz2
libpwdgrp: fix thinko in getpwnam
function old new delta parse_file - 64 +64 getXXnam_r 162 138 -24 getXXnam 90 50 -40 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 64/-64) Total: 0 bytes Signed-off-by: Tito Ragusa <farmatito@tiscali.it> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libpwdgrp/pwd_grp.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c
index 7ec704e..3886fac 100644
--- a/libpwdgrp/pwd_grp.c
+++ b/libpwdgrp/pwd_grp.c
@@ -450,15 +450,7 @@ static void* FAST_FUNC getXXnam(const char *name, unsigned db_and_field_pos)
char *buf;
struct passdb *db = &get_S()->db[db_and_field_pos >> 2];
- if (!db->fp) {
- db->fp = fopen_for_read(db->filename);
- if (!db->fp) {
- return NULL;
- }
- close_on_exec_on(fileno(db->fp));
- }
-
- buf = parse_common(db->fp, db, name, db_and_field_pos & 3);
+ buf = parse_file(db, name, db_and_field_pos & 3);
return massage_data_for_non_r_func(db, buf);
}