Re: [gtk-list] Re: Problems with GLib & Gdk



Hi, 

> > Whenever I try to run the GNOME panel I get a
> >
> >
> >     [ Part 1.2: "Attached Text" ]
> >
> >
> > GLib-WARNING **: getpwuid_r(): failed due to: No such file or 
> > directory
> 
> hi george, could you try to add a call to setpwent() in 
> g_get_any_init():
> 
>         [...]
>         do
>           {
>             g_free (buffer);
>             buffer = g_malloc (bufsize);
> 
> +           setpwent ();
> 
> #    ifdef HAVE_GETPWUID_R_POSIX
>             error = getpwuid_r (getuid (), &pwd, buffer, bufsize, &pw);
>             error = error < 0 ? errno : error;
> #    else /* !HAVE_GETPWUID_R_POSIX */
>             pw = getpwuid_r (getuid (), &pwd, buffer, bufsize);
>             error = pw ? 0 : errno;
> #    endif /* !HAVE_GETPWUID_R_POSIX */

No, do not do that. It's wrong and doesn't help (thats at least my view).
This 'No such file or directory' error could happen with the old version,
which was 'error = error < 1 ? errno : error;', because errno could be
nonzero, while error was zero. this is due to getpwuid_r trying to open
different files in order, where the first calls might fail.

> also i'd like to know what glib/config.h contains to define/undefine
> HAVE_GETPWUID_R_POSIX and HAVE_GETPWUID_R.

just look in configure.in ;-)
 
> if the above doesn't fix your problem we need, upon failing
> getpwuid_r(), fallback to using the usual code sequence of setpwent,
> getpwuid, endpwent which should actually succeed unless your system is
> totaly screwed /etc/passwd wise (in which case you couldn't even login

The last commit should actually work now. (I've heard that times and times
before ;-)

Bye,
Sebastian

-- 
Sebastian Wilhelmi                   |            här ovanför alla molnen
mailto:wilhelmi@ira.uka.de           |      är himmlen så förunerligt blå
http://goethe.ira.uka.de/~wilhelmi   |



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]