+2004-06-03 Ken Raeburn <raeburn@mit.edu>
+
+ * prof_file.c (profile_open_file): Handle earlier (draft POSIX)
+ specifications of getpwuid_r.
+
2004-06-02 Ken Raeburn <raeburn@mit.edu>
* configure.in: Check for getpwuid_r.
#endif
uid = getuid();
-#ifdef HAVE_GETPWUID_R
+#ifndef HAVE_GETPWUID_R
+ pw = getpwuid(uid);
+#elif defined(GETPWUID_R_4_ARGS)
+ /* earlier POSIX drafts */
+ pw = getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf));
+#else
+ /* POSIX */
if (getpwuid_r(uid, &pwx, pwbuf, sizeof(pwbuf), &pw) != 0)
/* Probably already null, but let's make sure. */
pw = NULL;
-#else
- pw = getpwuid(uid);
-#endif
+#endif /* getpwuid variants */
if (pw != NULL && pw->pw_dir[0] != 0)
home_env = pw->pw_dir;
}