about summary refs log tree commit diff
path: root/nss/nss_files
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-07-16 16:55:45 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-07-21 07:33:33 +0200
commit9980bf0b307368959cb29f3ca3f7446ad92347f1 (patch)
tree4378fc4c7bf49ae0e5c24147b3cf195a1e5eb2bc /nss/nss_files
parente9b2340998ab22402a8e968ba674c380a625b9dc (diff)
downloadglibc-9980bf0b307368959cb29f3ca3f7446ad92347f1.tar.gz
glibc-9980bf0b307368959cb29f3ca3f7446ad92347f1.tar.xz
glibc-9980bf0b307368959cb29f3ca3f7446ad92347f1.zip
nss_files: Use generic result pointer in parse_line
As a result, all parse_line functions have the same prototype, except
for that producing struct hostent.  This change is ABI-compatible, so
it does not alter the internal GLIBC_PRIVATE ABI (otherwise we should
probably have renamed the exported functions).

A future change will use this to implement a generict fget*ent_r
function.

Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nss/nss_files')
-rw-r--r--nss/nss_files/files-parse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c
index 382028765b..c6cd43babe 100644
--- a/nss/nss_files/files-parse.c
+++ b/nss/nss_files/files-parse.c
@@ -87,7 +87,7 @@ struct parser_data
 #ifdef EXTERN_PARSER
 
 /* The parser is defined in a different module.  */
-extern int parse_line (char *line, struct STRUCTURE *result,
+extern int parse_line (char *line, void *result,
 		       struct parser_data *data, size_t datalen, int *errnop
 		       EXTRA_ARGS_DECL);
 
@@ -99,10 +99,11 @@ extern int parse_line (char *line, struct STRUCTURE *result,
 
 # define LINE_PARSER(EOLSET, BODY)					      \
 parser_stclass int							      \
-parse_line (char *line, struct STRUCTURE *result,			      \
+parse_line (char *line, void *generic_result,				      \
 	    struct parser_data *data, size_t datalen, int *errnop	      \
 	    EXTRA_ARGS_DECL)						      \
 {									      \
+  struct STRUCTURE *result = generic_result;				      \
   ENTDATA_DECL (data)							      \
   BUFFER_PREPARE							      \
   char *p = strpbrk (line, EOLSET "\n");				      \