diff --git a/contrib/pg_upgrade/util.c b/contrib/pg_upgrade/util.c
new file mode 100644
index a67bd64..9ad4220
*** a/contrib/pg_upgrade/util.c
--- b/contrib/pg_upgrade/util.c
*************** get_user_info(char **user_name)
*** 228,234 ****
  	user_id = 1;
  #endif
  
! 	*user_name = pg_strdup(pw->pw_name);
  
  	return user_id;
  }
--- 228,237 ----
  	user_id = 1;
  #endif
  
! 	if (pw)
! 		*user_name = pg_strdup(pw->pw_name);
! 	else
! 		*user_name = NULL;
  
  	return user_id;
  }
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
new file mode 100644
index 30e3701..8665595
*** a/src/bin/initdb/initdb.c
--- b/src/bin/initdb/initdb.c
*************** get_id(void)
*** 795,801 ****
  	{
  		fprintf(stderr,
  			  _("%s: could not obtain information about current user: %s\n"),
! 				progname, strerror(errno));
  		exit(1);
  	}
  #else							/* the windows code */
--- 795,801 ----
  	{
  		fprintf(stderr,
  			  _("%s: could not obtain information about current user: %s\n"),
! 				progname, errno ? strerror(errno) : "not an operating system user");
  		exit(1);
  	}
  #else							/* the windows code */
