diff options
author | George Lebl <jirka@5z.com> | 2003-07-25 00:41:40 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2003-07-25 00:41:40 +0000 |
commit | 235f9c32231d0a32198d18a5b2a531e5e31c373c (patch) | |
tree | 343021114e3bb15e8e92844f1c6e1dd71e3d1c63 | |
parent | 542d6bad2484a6c9f344ee5cf3979762ca3e19fc (diff) | |
download | gdm-235f9c32231d0a32198d18a5b2a531e5e31c373c.tar.gz |
fix build on systems without PIPE_BUF but with _PC_PIPE_BUF
Thu Jul 24 17:40:09 2003 George Lebl <jirka@5z.com>
* gui/gdmgreeter.c: fix build on systems without PIPE_BUF
but with _PC_PIPE_BUF
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gui/gdmchooser.c | 19 |
2 files changed, 20 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Thu Jul 24 17:40:09 2003 George Lebl <jirka@5z.com> + + * gui/gdmgreeter.c: fix build on systems without PIPE_BUF + but with _PC_PIPE_BUF + Thu Jul 24 16:41:25 2003 George Lebl <jirka@5z.com> * docs/C/gdm.xml: update the version information on top diff --git a/gui/gdmchooser.c b/gui/gdmchooser.c index aa71495b..f63708cc 100644 --- a/gui/gdmchooser.c +++ b/gui/gdmchooser.c @@ -382,6 +382,7 @@ gdm_chooser_decode_packet (GIOChannel *source, gchar *status = NULL; ARRAY8 auth, host, stat; GdmChooserHost *gh; + int pipe_buf; if (! XdmcpFill (sockfd, &buf, (XdmcpNetaddr) &clnt_sa, &sa_len)) return TRUE; @@ -417,10 +418,6 @@ gdm_chooser_decode_packet (GIOChannel *source, hostname = (he && he->h_name) ? he->h_name : inet_ntoa (clnt_sa.sin_addr); - /* We can't pipe hostnames larger than this */ - if (strlen (hostname)+1 > PIPE_BUF) - goto done; - hostname = g_strdup (hostname); } else { hostname = g_new0 (char, 1024); @@ -430,6 +427,20 @@ gdm_chooser_decode_packet (GIOChannel *source, } } +#ifdef PIPE_BUF + pipe_buf = PIPE_BUF; +#else + /* apparently Hurd doesn't have PIPE_BUF */ + pipe_buf = fpathconf (1 /*stdout*/, _PC_PIPE_BUF); + /* could return -1 if no limit */ +#endif + + /* We can't pipe hostnames larger than this */ + if (pipe_buf > 0 && strlen (hostname)+1 > pipe_buf) { + g_free (hostname); + goto done; + } + gh = gdm_host_known (&clnt_sa.sin_addr); if (gh == NULL) { gh = gdm_chooser_host_alloc (hostname, |