openbsd-ports/x11/gnome/controlcenter2/patches/patch-capplets_about-me_gnome-about-me_c
jasper 8881e262f4 - update control-center2 to 2.24.0.1
feedback and ok ajacoutot@
2008-11-21 17:02:49 +00:00

31 lines
958 B
Plaintext

$OpenBSD: patch-capplets_about-me_gnome-about-me_c,v 1.2 2008/11/21 17:02:49 jasper Exp $
--- capplets/about-me/gnome-about-me.c.orig Tue Nov 11 20:57:09 2008
+++ capplets/about-me/gnome-about-me.c Tue Nov 11 20:58:39 2008
@@ -32,6 +32,7 @@
#include <glade/glade.h>
#include <pwd.h>
#include <unistd.h>
+#include <sys/types.h>
#include <libebook/e-book.h>
#include "e-image-chooser.h"
@@ -330,12 +331,17 @@ static char *
get_user_login (void)
{
char buf[LINE_MAX * 4];
- struct passwd pwd, *err;
+ struct passwd *pwd;
int i;
#if defined(__sun) && !defined(_POSIX_PTHREAD_SEMANTICS)
i = getpwuid_r (getuid (), &pwd, buf, sizeof (buf));
return (i != 0) ? g_strdup (pwd.pw_name) : NULL;
+#elif __OpenBSD__
+ pwd = getpwuid(getuid());
+ if (pwd == NULL)
+ return NULL;
+ return g_strdup (pwd->pw_name);
#else
i = getpwuid_r (getuid (), &pwd, buf, sizeof (buf), &err);
return ((i == 0) && (err == &pwd)) ? g_strdup (pwd.pw_name) : NULL;