tizen: Use getline() when building nss_optfiles
authorŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 21 Jul 2022 21:02:23 +0000 (23:02 +0200)
committerDongkyun Son <dongkyun.s@samsung.com>
Wed, 3 May 2023 10:49:30 +0000 (19:49 +0900)
After moving to libc (6212bb67f4 "nss_files: Move into libc") started
using __getline() (0e1f068108 "Fix linknamespace errors and
local-plt-usages in nss_files.") which is not available when building
nss_optfiles as a module.

Change-Id: I1e7443bcb64b6c63c8d47b53afdc3e8916702416
Fixes: 0b9125e2a3 ("tizen: Add optfiles nss module")
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
nss/nss_files/files-initgroups.c

index f1715e1..0557f00 100644 (file)
@@ -68,7 +68,11 @@ CONCAT3(_nss_, NSSNAME, _initgroups_dyn) (const char *user, gid_t group, long in
     {
       fpos_t pos;
       fgetpos (stream, &pos);
+#ifndef DATAFILE_PREFIX_PATH /* nss_files */
       ssize_t n = __getline (&line, &linelen, stream);
+#else /* nss_optfiles */
+      ssize_t n = getline (&line, &linelen, stream);
+#endif
       if (n < 0)
        {
          if (! __feof_unlocked (stream))