$OpenBSD: patch-common_src_ipmi-sdr-cache_c,v 1.1.1.1 2007/10/25 18:17:02 wilfried Exp $
--- common/src/ipmi-sdr-cache.c.orig	Wed Oct 10 06:54:44 2007
+++ common/src/ipmi-sdr-cache.c	Tue Oct 23 17:21:22 2007
@@ -173,7 +173,11 @@ _get_home_directory (sdr_cache_ctx_t ctx,
                      unsigned int homebuflen)
 {
   uid_t user_id;
+#ifdef HAVE_GETPWUID_R
   struct passwd *user_passwd = alloca (sizeof (*user_passwd));
+#else
+  struct passwd *user_passwd;
+#endif
   long int buf_len;
   char *buf;
   int ret;
@@ -196,7 +200,11 @@ _get_home_directory (sdr_cache_ctx_t ctx,
     }
 
   user_id = getuid ();
+#ifdef HAVE_GETPWUID_R
   if (getpwuid_r (user_id, user_passwd, buf, buf_len, &user_passwd) != 0)
+#else
+  if ((user_passwd = getpwuid (user_id)) == 0)
+#endif
     {
       ctx->errnum = SDR_CACHE_CTX_ERR_INTERNAL;
       return -1;
