+2005-03-05 Havoc Pennington <hp@redhat.com>
+
+ * dbus/dbus-sysdeps.c:
+ (pseudorandom_generate_random_bytes_buffer): fix to have no return
+ value
+ (_dbus_generate_random_bytes_buffer): fix return value
+
+ * dbus/dbus-sysdeps-util.c: s/GETPWNAME/GETPWNAM/ so configure
+ checks actually work, from Tom Parker <fdo@tevp.net>
+
2005-03-01 Colin Walters <walters@verbum.org>
* test/glib/test-dbus-glib.c (lose, lose_gerror): Utility
* to add more configure checks.
*/
-#if defined (HAVE_POSIX_GETPWNAME_R) || defined (HAVE_NONPOSIX_GETPWNAME_R)
+#if defined (HAVE_POSIX_GETPWNAM_R) || defined (HAVE_NONPOSIX_GETPWNAM_R)
{
struct group *g;
int result;
struct group g_str;
g = NULL;
-#ifdef HAVE_POSIX_GETPWNAME_R
+#ifdef HAVE_POSIX_GETPWNAM_R
if (group_c_str)
result = getgrnam_r (group_c_str, &g_str, buf, sizeof (buf),
#else
p = getgrnam_r (group_c_str, &g_str, buf, sizeof (buf));
result = 0;
-#endif /* !HAVE_POSIX_GETPWNAME_R */
+#endif /* !HAVE_POSIX_GETPWNAM_R */
if (result == 0 && g == &g_str)
{
return fill_user_info_from_group (g, info, error);
* checks
*/
-#if defined (HAVE_POSIX_GETPWNAME_R) || defined (HAVE_NONPOSIX_GETPWNAME_R)
+#if defined (HAVE_POSIX_GETPWNAM_R) || defined (HAVE_NONPOSIX_GETPWNAM_R)
{
struct passwd *p;
int result;
struct passwd p_str;
p = NULL;
-#ifdef HAVE_POSIX_GETPWNAME_R
- if (uid >= 0)
+#ifdef HAVE_POSIX_GETPWNAM_R
+ if (uid != DBUS_UID_UNSET)
result = getpwuid_r (uid, &p_str, buf, sizeof (buf),
&p);
else
else
p = getpwnam_r (username_c, &p_str, buf, sizeof (buf));
result = 0;
-#endif /* !HAVE_POSIX_GETPWNAME_R */
+#endif /* !HAVE_POSIX_GETPWNAM_R */
if (result == 0 && p == &p_str)
{
if (!fill_user_info_from_passwd (p, info, error))
_dbus_string_get_length (dir));
}
-static dbus_bool_t
+static void
pseudorandom_generate_random_bytes_buffer (char *buffer,
int n_bytes)
{
DBusString str;
if (!_dbus_string_init (&str))
- return pseudorandom_generate_random_bytes_buffer (buffer, n_bytes);
+ {
+ pseudorandom_generate_random_bytes_buffer (buffer, n_bytes);
+ return;
+ }
if (!_dbus_generate_random_bytes (&str, n_bytes))
{
_dbus_string_free (&str);
- return pseudorandom_generate_random_bytes_buffer (buffer, n_bytes);
+ pseudorandom_generate_random_bytes_buffer (buffer, n_bytes);
+ return;
}
_dbus_string_copy_to_buffer (&str, buffer, n_bytes);