about summary refs log tree commit diff
path: root/shadow
diff options
context:
space:
mode:
Diffstat (limited to 'shadow')
-rw-r--r--shadow/fgetspent_r.c6
-rw-r--r--shadow/sgetspent_r.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/shadow/fgetspent_r.c b/shadow/fgetspent_r.c
index 403eecf761..8c4638d40d 100644
--- a/shadow/fgetspent_r.c
+++ b/shadow/fgetspent_r.c
@@ -17,6 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <ctype.h>
+#include <errno.h>
 #include <shadow.h>
 #include <stdio.h>
 
@@ -28,7 +29,7 @@
 #define	EXTERN_PARSER	1
 struct spent_data {};
 
-#include "../nss/nss_files/files-parse.c"
+#include <nss/nss_files/files-parse.c>
 
 
 /* Read one shadow entry from the given stream.  */
@@ -53,7 +54,8 @@ __fgetspent_r (FILE *stream, struct spwd *resbuf, char *buffer, size_t buflen,
     } while (*p == '\0' || *p == '#' ||	/* Ignore empty and comment lines.  */
 	     /* Parse the line.  If it is invalid, loop to
 		get the next line of the file to parse.  */
-	     ! parse_line (buffer, (void *) resbuf, NULL, 0));
+	     ! parse_line (buffer, (void *) resbuf, NULL, 0,
+			   __errno_location ()));
 
   *result = resbuf;
   return 0;
diff --git a/shadow/sgetspent_r.c b/shadow/sgetspent_r.c
index 01f0115164..f3e322aa87 100644
--- a/shadow/sgetspent_r.c
+++ b/shadow/sgetspent_r.c
@@ -17,6 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <ctype.h>
+#include <errno.h>
 #include <shadow.h>
 #include <stdio.h>
 #include <string.h>
@@ -91,7 +92,7 @@ __sgetspent_r (const char *string, struct spwd *resbuf, char *buffer,
 	       size_t buflen, struct spwd **result)
 {
   int parse_result = parse_line (strncpy (buffer, string, buflen),
-				 resbuf, NULL, 0);
+				 resbuf, NULL, 0, __errno_location ());
   *result = parse_result > 0 ? resbuf : NULL;
 
   return *result == NULL ? errno : 0;