Requires pkgconfig.
[fedora-mingw.git] / gtk-vnc / gtk-vnc-0.3.7-mingw32-dan3.patch
1 diff -urN gtk-vnc-0.3.7.abs/bootstrap gtk-vnc-0.3.7.dan3/bootstrap
2 --- gtk-vnc-0.3.7.abs/bootstrap 1970-01-01 01:00:00.000000000 +0100
3 +++ gtk-vnc-0.3.7.dan3/bootstrap        2008-10-09 15:23:00.000000000 +0100
4 @@ -0,0 +1,89 @@
5 +#!/bin/sh
6 +# Run this after autogen.sh, to pull in all of the gnulib-related bits.
7 +# It's important to run *after* autogen.sh, since it updates some of
8 +# the same files autogen.sh does, yet those from gnulib are newer,
9 +# and match the tests.  So if a gnulib bug has been fixed since the
10 +# snapshot taken for whatever gettext release you're using, yet you
11 +# run "make check" against the wrong version, the corresponding unit
12 +# test in gl-tests/ may well fail.
13 +
14 +usage() {
15 +  echo >&2 "\
16 +Usage: $0 [OPTION]...
17 +Bootstrap this package from the checked-out sources.
18 +
19 +Options:
20 + --gnulib-srcdir=DIRNAME  Specify the local directory where gnulib
21 +                          sources reside.  Use this if you already
22 +                          have gnulib sources on your machine, and
23 +                          do not want to waste your bandwidth downloading
24 +                          them again.
25 +
26 +If the file bootstrap.conf exists in the current working directory, its
27 +contents are read as shell variables to configure the bootstrap.
28 +
29 +Running without arguments will suffice in most cases.
30 +"
31 +}
32 +
33 +for option
34 +do
35 +  case $option in
36 +  --help)
37 +    usage
38 +    exit;;
39 +  --gnulib-srcdir=*)
40 +    GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
41 +  *)
42 +    echo >&2 "$0: $option: unknown option"
43 +    exit 1;;
44 +  esac
45 +done
46 +
47 +cleanup_gnulib() {
48 +  st=$?
49 +  rm -fr .gnulib
50 +  exit $st
51 +}
52 +
53 +case ${GNULIB_SRCDIR--} in
54 +-)
55 +  if [ ! -d .gnulib ]; then
56 +    echo "$0: getting gnulib files..."
57 +
58 +    trap cleanup_gnulib 1 2 13 15
59 +
60 +    git clone --depth 1 git://git.sv.gnu.org/gnulib .gnulib ||
61 +      cleanup_gnulib
62 +
63 +    trap - 1 2 13 15
64 +  fi
65 +  GNULIB_SRCDIR=.gnulib
66 +esac
67 +
68 +gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
69 +<$gnulib_tool || exit
70 +
71 +modules='
72 +getaddrinfo
73 +socket
74 +recv
75 +send
76 +connect
77 +malloc
78 +vc-list-files
79 +'
80 +
81 +# Tell gnulib to:
82 +#   require LGPLv2+
83 +#   put *.m4 files in new gnulib/m4/ dir
84 +#   put *.[ch] files in new gnulib/lib/ dir.
85 +
86 +$gnulib_tool                   \
87 +  --lgpl=2                     \
88 +  --with-tests                 \
89 +  --m4-base=gnulib/m4          \
90 +  --source-base=gnulib/lib     \
91 +  --tests-base=gnulib/tests    \
92 +  --import $modules
93 +
94 diff -urN gtk-vnc-0.3.7.abs/configure.ac gtk-vnc-0.3.7.dan3/configure.ac
95 --- gtk-vnc-0.3.7.abs/configure.ac      2008-09-05 13:32:15.000000000 +0100
96 +++ gtk-vnc-0.3.7.dan3/configure.ac     2008-10-09 15:23:00.000000000 +0100
97 @@ -23,15 +23,29 @@
98  
99  AC_CONFIG_HEADERS([config.h:config.hin])
100  
101 -
102  AC_CANONICAL_TARGET
103  
104  AM_INIT_AUTOMAKE(gtk-vnc, 0.3.7)
105  
106 +
107 +dnl gl_INIT uses m4_foreach_w, yet that is not defined in autoconf-2.59.
108 +dnl In order to accommodate developers with such old tools, here's a
109 +dnl replacement definition.
110 +m4_ifndef([m4_foreach_w],
111 +  [m4_define([m4_foreach_w],
112 +    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
113 +
114 +gl_EARLY
115 +gl_INIT
116 +
117  AC_PROG_CC_STDC
118  AM_PROG_CC_C_O
119 +AC_LIBTOOL_WIN32_DLL
120 +
121  AC_PROG_LIBTOOL
122  
123 +AC_CHECK_HEADERS([pwd.h winsock2.h])
124 +
125  AC_ARG_WITH(python,
126  [  --with-python           build python bindings],
127  [case "${withval}" in
128 @@ -234,6 +248,8 @@
129  
130  AC_CONFIG_FILES(
131    Makefile
132 +  gnulib/lib/Makefile
133 +  gnulib/tests/Makefile
134    src/Makefile
135    examples/Makefile
136    plugin/Makefile
137 diff -urN gtk-vnc-0.3.7.abs/Makefile.am gtk-vnc-0.3.7.dan3/Makefile.am
138 --- gtk-vnc-0.3.7.abs/Makefile.am       2008-09-05 13:32:15.000000000 +0100
139 +++ gtk-vnc-0.3.7.dan3/Makefile.am      2008-10-09 15:22:57.000000000 +0100
140 @@ -1,5 +1,9 @@
141  
142 -SUBDIRS = src examples plugin
143 +SUBDIRS = gnulib/lib src examples plugin gnulib/tests
144 +
145 +ACLOCAL_AMFLAGS = -I gnulib/m4
146 +
147 +
148  
149  pkgconfig_DATA = @PACKAGE@-1.0.pc
150  pkgconfigdir = $(libdir)/pkgconfig
151 diff -urN gtk-vnc-0.3.7.abs/src/continuation.c gtk-vnc-0.3.7.dan3/src/continuation.c
152 --- gtk-vnc-0.3.7.abs/src/continuation.c        2008-09-05 13:32:16.000000000 +0100
153 +++ gtk-vnc-0.3.7.dan3/src/continuation.c       2008-10-09 15:23:00.000000000 +0100
154 @@ -8,6 +8,8 @@
155   *  GTK VNC Widget
156   */
157  
158 +#include <config.h>
159 +
160  #include "continuation.h"
161  
162  /*
163 diff -urN gtk-vnc-0.3.7.abs/src/coroutine_gthread.c gtk-vnc-0.3.7.dan3/src/coroutine_gthread.c
164 --- gtk-vnc-0.3.7.abs/src/coroutine_gthread.c   2008-09-05 13:32:16.000000000 +0100
165 +++ gtk-vnc-0.3.7.dan3/src/coroutine_gthread.c  2008-10-09 15:23:00.000000000 +0100
166 @@ -8,6 +8,8 @@
167   *  GTK VNC Widget
168   */
169  
170 +#include <config.h>
171 +
172  #include "coroutine.h"
173  #include <stdio.h>
174  #include <stdlib.h>
175 @@ -17,13 +19,24 @@
176  static struct coroutine *current;
177  static struct coroutine leader;
178  
179 +#if 0
180 +#define CO_DEBUG(OP) fprintf(stderr, "%s %p %s %d\n", OP, g_thread_self(), __FUNCTION__, __LINE__)
181 +#else
182 +#define CO_DEBUG(OP)
183 +#endif
184 +
185  static void coroutine_system_init(void)
186  {
187 -       if (!g_thread_supported())
188 +       if (!g_thread_supported()) {
189 +               CO_DEBUG("INIT");
190                 g_thread_init(NULL);
191 +       }
192 +
193  
194         run_cond = g_cond_new();
195         run_lock = g_mutex_new();
196 +       CO_DEBUG("LOCK");
197 +       g_mutex_lock(run_lock);
198  
199         /* The thread that creates the first coroutine is the system coroutine
200          * so let's fill out a structure for it */
201 @@ -42,17 +55,22 @@
202  static gpointer coroutine_thread(gpointer opaque)
203  {
204         struct coroutine *co = opaque;
205 -
206 +       CO_DEBUG("LOCK");
207         g_mutex_lock(run_lock);
208 -       while (!co->runnable)
209 +       while (!co->runnable) {
210 +               CO_DEBUG("WAIT");
211                 g_cond_wait(run_cond, run_lock);
212 +       }
213  
214 +       CO_DEBUG("RUNNABLE");
215         current = co;
216         co->data = co->entry(co->data);
217         co->exited = 1;
218  
219         co->caller->runnable = TRUE;
220 +       CO_DEBUG("BROADCAST");
221         g_cond_broadcast(run_cond);
222 +       CO_DEBUG("UNLOCK");
223         g_mutex_unlock(run_lock);
224  
225         return NULL;
226 @@ -62,7 +80,8 @@
227  {
228         if (run_cond == NULL)
229                 coroutine_system_init();
230 -       
231 +
232 +       CO_DEBUG("NEW");
233         co->thread = g_thread_create_full(coroutine_thread, co, co->stack_size,
234                                           FALSE, TRUE,
235                                           G_THREAD_PRIORITY_NORMAL,
236 @@ -88,15 +107,19 @@
237         to->runnable = TRUE;
238         to->data = arg;
239         to->caller = from;
240 +       CO_DEBUG("BROADCAST");
241         g_cond_broadcast(run_cond);
242 +       CO_DEBUG("UNLOCK");
243         g_mutex_unlock(run_lock);
244 -
245 +       CO_DEBUG("LOCK");
246         g_mutex_lock(run_lock);
247 -       while (!from->runnable)
248 +       while (!from->runnable) {
249 +               CO_DEBUG("WAIT");
250                 g_cond_wait(run_cond, run_lock);
251 -
252 +       }
253         current = from;
254  
255 +       CO_DEBUG("SWAPPED");
256         return from->data;
257  }
258  
259 @@ -111,6 +134,7 @@
260                 fprintf(stderr, "Co-routine is re-entering itself\n");
261                 abort();
262         }
263 +       CO_DEBUG("SWAP");
264         return coroutine_swap(coroutine_self(), to, arg);
265  }
266  
267 @@ -121,6 +145,8 @@
268                 fprintf(stderr, "Co-routine is yielding to no one\n");
269                 abort();
270         }
271 +
272 +       CO_DEBUG("SWAP");
273         coroutine_self()->caller = NULL;
274         return coroutine_swap(coroutine_self(), to, arg);
275  }
276 diff -urN gtk-vnc-0.3.7.abs/src/coroutine_ucontext.c gtk-vnc-0.3.7.dan3/src/coroutine_ucontext.c
277 --- gtk-vnc-0.3.7.abs/src/coroutine_ucontext.c  2008-09-05 13:32:16.000000000 +0100
278 +++ gtk-vnc-0.3.7.dan3/src/coroutine_ucontext.c 2008-10-09 15:23:00.000000000 +0100
279 @@ -8,6 +8,8 @@
280   *  GTK VNC Widget
281   */
282  
283 +#include <config.h>
284 +
285  #include <sys/types.h>
286  #include <sys/mman.h>
287  #include <stdio.h>
288 diff -urN gtk-vnc-0.3.7.abs/src/gvnc.c gtk-vnc-0.3.7.dan3/src/gvnc.c
289 --- gtk-vnc-0.3.7.abs/src/gvnc.c        2008-09-05 13:32:16.000000000 +0100
290 +++ gtk-vnc-0.3.7.dan3/src/gvnc.c       2008-10-09 15:23:00.000000000 +0100
291 @@ -8,13 +8,14 @@
292   *  GTK VNC Widget
293   */
294  
295 +#include <config.h>
296 +
297  #include "gvnc.h"
298  
299  #include <sys/socket.h>
300  #include <netinet/in.h>
301  #include <arpa/inet.h>
302  
303 -#include <netdb.h>
304  #include <string.h>
305  #include <unistd.h>
306  #include <stdio.h>
307 @@ -40,6 +41,14 @@
308  #include <gdk/gdkkeysyms.h>
309  
310  #include "vnc_keycodes.h"
311 +#include "getaddrinfo.h"
312 +
313 +/* AI_ADDRCONFIG is missing on some systems and gnulib won't provide it
314 +   even if its emulated getaddrinfo() for us . */
315 +#ifndef AI_ADDRCONFIG
316 +# define AI_ADDRCONFIG 0
317 +#endif
318 +
319  
320  struct wait_queue
321  {
322 @@ -185,7 +194,6 @@
323  
324         g_io_add_watch(channel, cond | G_IO_HUP | G_IO_ERR | G_IO_NVAL, g_io_wait_helper, coroutine_self());
325         ret = coroutine_yield(NULL);
326 -
327         return *ret;
328  }
329  
330 @@ -344,7 +352,7 @@
331         size_t offset = 0;
332  
333         if (gvnc->has_error) return -EINVAL;
334 -       
335 +
336         while (offset < len) {
337                 size_t tmp;
338  
339 @@ -376,7 +384,7 @@
340  
341                         if (ret == -1) {
342                                 switch (errno) {
343 -                               case EAGAIN:
344 +                               case EWOULDBLOCK:
345                                         if (gvnc->wait_interruptable) {
346                                                 if (!g_io_wait_interruptable(&gvnc->wait,
347                                                                              gvnc->channel, G_IO_IN))
348 @@ -386,7 +394,7 @@
349                                 case EINTR:
350                                         continue;
351                                 default:
352 -                                       GVNC_DEBUG("Closing the connection: gvnc_read() - ret=-1\n");
353 +                                       GVNC_DEBUG("Closing the connection: gvnc_read() - errno=%d\n", errno);
354                                         gvnc->has_error = TRUE;
355                                         return -errno;
356                                 }
357 @@ -436,12 +444,12 @@
358                                     gvnc->write_offset-offset);
359                 if (ret == -1) {
360                         switch (errno) {
361 -                       case EAGAIN:
362 +                       case EWOULDBLOCK:
363                                 g_io_wait(gvnc->channel, G_IO_OUT);
364                         case EINTR:
365                                 continue;
366                         default:
367 -                               GVNC_DEBUG("Closing the connection: gvnc_flush\n");
368 +                               GVNC_DEBUG("Closing the connection: gvnc_flush %d\n", errno);
369                                 gvnc->has_error = TRUE;
370                                 return;
371                         }
372 @@ -1341,12 +1349,12 @@
373  static int gvnc_read_zrle_rl(struct gvnc *gvnc)
374  {
375         int rl = 1;
376 -       uint8_t byte;
377 +       uint8_t b;
378  
379         do {
380 -               byte = gvnc_read_u8(gvnc);
381 -               rl += byte;
382 -       } while (!gvnc_has_error(gvnc) && byte == 255);
383 +               b = gvnc_read_u8(gvnc);
384 +               rl += b;
385 +       } while (!gvnc_has_error(gvnc) && b == 255);
386  
387         return rl;
388  }
389 @@ -2802,12 +2810,12 @@
390         if (gvnc_has_error(gvnc))
391                 return FALSE;
392  
393 -       if (!gvnc->fmt.true_color_flag && gvnc->ops.get_preferred_pixel_format)
394 +       if (!gvnc->fmt.true_color_flag && gvnc->ops.get_preferred_pixel_format) {
395                 if (gvnc->ops.get_preferred_pixel_format(gvnc->ops_data, &gvnc->fmt))
396                         gvnc_set_pixel_format(gvnc, &gvnc->fmt);
397                 else
398                         goto fail;
399 -
400 +       }
401         memset(&gvnc->strm, 0, sizeof(gvnc->strm));
402         /* FIXME what level? */
403         for (i = 0; i < 5; i++)
404 @@ -2822,15 +2830,16 @@
405         return !gvnc_has_error(gvnc);
406  }
407  
408 -gboolean gvnc_open_fd(struct gvnc *gvnc, int fd)
409 +static gboolean gvnc_set_nonblock(int fd)
410  {
411 -       int flags;
412 -       if (gvnc_is_open(gvnc)) {
413 -               GVNC_DEBUG ("Error: already connected?\n");
414 +#ifdef __MINGW32__
415 +       unsigned long flags = 1;
416 +       if (ioctlsocket(fd, FIONBIO, &flags) < 0) {
417 +               GVNC_DEBUG ("Failed to set nonblocking flag\n");
418                 return FALSE;
419         }
420 -
421 -       GVNC_DEBUG("Connecting to FD %d\n", fd);
422 +#else
423 +       int flags;
424         if ((flags = fcntl(fd, F_GETFL)) < 0) {
425                 GVNC_DEBUG ("Failed to fcntl()\n");
426                 return FALSE;
427 @@ -2840,6 +2849,21 @@
428                 GVNC_DEBUG ("Failed to fcntl()\n");
429                 return FALSE;
430         }
431 +#endif
432 +       return TRUE;
433 +}
434 +
435 +gboolean gvnc_open_fd(struct gvnc *gvnc, int fd)
436 +{
437 +       if (gvnc_is_open(gvnc)) {
438 +               GVNC_DEBUG ("Error: already connected?\n");
439 +               return FALSE;
440 +       }
441 +
442 +       GVNC_DEBUG("Connecting to FD %d\n", fd);
443 +
444 +       if (!gvnc_set_nonblock(fd))
445 +               return FALSE;
446  
447         if (!(gvnc->channel = g_io_channel_unix_new(fd))) {
448                 GVNC_DEBUG ("Failed to g_io_channel_unix_new()\n");
449 @@ -2873,7 +2897,7 @@
450  
451          runp = ai;
452          while (runp != NULL) {
453 -                int flags, fd;
454 +                int fd;
455                  GIOChannel *chan;
456  
457                 if ((fd = socket(runp->ai_family, runp->ai_socktype,
458 @@ -2883,17 +2907,8 @@
459                 }
460  
461                  GVNC_DEBUG("Trying socket %d\n", fd);
462 -                if ((flags = fcntl(fd, F_GETFL)) < 0) {
463 -                        close(fd);
464 -                        GVNC_DEBUG ("Failed to fcntl()\n");
465 -                        break;
466 -                }
467 -                flags |= O_NONBLOCK;
468 -                if (fcntl(fd, F_SETFL, flags) < 0) {
469 -                        close(fd);
470 -                        GVNC_DEBUG ("Failed to fcntl()\n");
471 -                        break;
472 -                }
473 +               if (!gvnc_set_nonblock(fd))
474 +                       break;
475  
476                  if (!(chan = g_io_channel_unix_new(fd))) {
477                          close(fd);
478 @@ -2904,14 +2919,15 @@
479          reconnect:
480                  /* FIXME: Better handle EINPROGRESS/EISCONN return values,
481                     as explained in connect(2) man page */
482 -                if ( (connect(fd, runp->ai_addr, runp->ai_addrlen) == 0) || errno == EISCONN) {
483 +                if ((connect(fd, runp->ai_addr, runp->ai_addrlen) == 0) ||
484 +                   errno == EISCONN) {
485                          gvnc->channel = chan;
486                          gvnc->fd = fd;
487                          freeaddrinfo(ai);
488                          return !gvnc_has_error(gvnc);
489                  }
490 -
491 -                if (errno == EINPROGRESS) {
492 +                if (errno == EINPROGRESS ||
493 +                    errno == EWOULDBLOCK) {
494                          g_io_wait(chan, G_IO_OUT|G_IO_ERR|G_IO_HUP);
495                          goto reconnect;
496                  } else if (errno != ECONNREFUSED &&
497 diff -urN gtk-vnc-0.3.7.abs/src/Makefile.am gtk-vnc-0.3.7.dan3/src/Makefile.am
498 --- gtk-vnc-0.3.7.abs/src/Makefile.am   2008-09-05 13:32:15.000000000 +0100
499 +++ gtk-vnc-0.3.7.dan3/src/Makefile.am  2008-10-09 15:23:00.000000000 +0100
500 @@ -4,13 +4,15 @@
501  lib_LTLIBRARIES = libgtk-vnc-1.0.la
502  
503  libgtk_vnc_1_0_la_LIBADD = @GTK_LIBS@ @GTKGLEXT_LIBS@ @GNUTLS_LIBS@ \
504 -                          @GTHREAD_LIBS@
505 +                          @GTHREAD_LIBS@ \
506 +                           ../gnulib/lib/libgnu.la
507  libgtk_vnc_1_0_la_CFLAGS = @GTK_CFLAGS@ @GTKGLEXT_CFLAGS@ @GNUTLS_CFLAGS@ \
508                            @GTHREAD_CFLAGS@ @WARNING_CFLAGS@ \
509                            -DSYSCONFDIR=\""$(sysconfdir)"\" \
510 -                           -DG_LOG_DOMAIN=\"gtk-vnc\"
511 +                           -DG_LOG_DOMAIN=\"gtk-vnc\" \
512 +                           -I$(top_srcdir)gnulib/lib -I../gnulib/lib
513  libgtk_vnc_1_0_la_LDFLAGS = -Wl, @LD_VERSION_SCRIPT_SUPPORT@ \
514 -                            -version-info 0:1:0
515 +                            -version-info 0:1:0 -no-undefined
516  
517  gtk_vnc_includedir = $(includedir)/gtk-vnc-1.0/
518  gtk_vnc_include_HEADERS = vncdisplay.h
519 diff -urN gtk-vnc-0.3.7.abs/src/vncdisplay.c gtk-vnc-0.3.7.dan3/src/vncdisplay.c
520 --- gtk-vnc-0.3.7.abs/src/vncdisplay.c  2008-10-09 15:21:21.000000000 +0100
521 +++ gtk-vnc-0.3.7.dan3/src/vncdisplay.c 2008-10-09 15:23:00.000000000 +0100
522 @@ -8,6 +8,8 @@
523   *  GTK VNC Widget
524   */
525  
526 +#include <config.h>
527 +
528  #include "vncdisplay.h"
529  #include "coroutine.h"
530  #include "gvnc.h"
531 @@ -24,7 +26,9 @@
532  #include <sys/types.h>
533  #include <sys/stat.h>
534  #include <unistd.h>
535 +#ifdef HAVE_PWD_H
536  #include <pwd.h>
537 +#endif
538  
539  #if WITH_GTKGLEXT
540  #include <gtk/gtkgl.h>
541 @@ -2191,33 +2195,44 @@
542  
543  static int vnc_display_set_x509_credential(VncDisplay *obj, const char *name)
544  {
545 -       char sysdir[PATH_MAX], userdir[PATH_MAX];
546 -       struct passwd *pw;
547         char file[PATH_MAX];
548 +       char sysdir[PATH_MAX];
549 +#ifndef __MINGW32__
550 +       char userdir[PATH_MAX];
551 +       struct passwd *pw;
552         char *dirs[] = { sysdir, userdir };
553 +#else
554 +       char *dirs[] = { sysdir };
555 +#endif
556  
557         strncpy(sysdir, SYSCONFDIR "/pki", PATH_MAX-1);
558         sysdir[PATH_MAX-1] = '\0';
559  
560 +#ifndef __MINGW32__
561         if (!(pw = getpwuid(getuid())))
562                 return TRUE;
563  
564         snprintf(userdir, PATH_MAX-1, "%s/.pki", pw->pw_dir);
565         userdir[PATH_MAX-1] = '\0';
566 +#endif
567  
568 -       if (vnc_display_best_path(file, PATH_MAX, "CA", "cacert.pem", dirs, 2) < 0)
569 +       if (vnc_display_best_path(file, PATH_MAX, "CA", "cacert.pem",
570 +                                 dirs, sizeof(dirs)/sizeof(dirs[0])) < 0)
571                 return TRUE;
572         gvnc_set_credential_x509_cacert(obj->priv->gvnc, file);
573  
574         /* Don't mind failures of CRL */
575 -       if (vnc_display_best_path(file, PATH_MAX, "CA", "cacrl.pem", dirs, 2) == 0)
576 +       if (vnc_display_best_path(file, PATH_MAX, "CA", "cacrl.pem",
577 +                                 dirs, sizeof(dirs)/sizeof(dirs[0])) == 0)
578                 gvnc_set_credential_x509_cacert(obj->priv->gvnc, file);
579  
580         /* Set client key & cert if we have them. Server will reject auth
581          * if it decides it requires them*/
582 -       if (vnc_display_best_path(file, PATH_MAX, name, "private/clientkey.pem", dirs, 2) == 0)
583 +       if (vnc_display_best_path(file, PATH_MAX, name, "private/clientkey.pem",
584 +                                 dirs, sizeof(dirs)/sizeof(dirs[0])) == 0)
585                 gvnc_set_credential_x509_key(obj->priv->gvnc, file);
586 -       if (vnc_display_best_path(file, PATH_MAX, name, "clientcert.pem", dirs, 2) == 0)
587 +       if (vnc_display_best_path(file, PATH_MAX, name, "clientcert.pem",
588 +                                 dirs, sizeof(dirs)/sizeof(dirs[0])) == 0)
589                 gvnc_set_credential_x509_cert(obj->priv->gvnc, file);
590  
591         return FALSE;
592 diff -urN gtk-vnc-0.3.7.abs/vc-list-files gtk-vnc-0.3.7.dan3/vc-list-files
593 --- gtk-vnc-0.3.7.abs/vc-list-files     1970-01-01 01:00:00.000000000 +0100
594 +++ gtk-vnc-0.3.7.dan3/vc-list-files    2008-10-09 15:23:00.000000000 +0100
595 @@ -0,0 +1,107 @@
596 +#!/bin/sh
597 +# List version-controlled file names.
598 +
599 +# Print a version string.
600 +scriptversion=2008-07-11.19
601 +
602 +# Copyright (C) 2006-2008 Free Software Foundation, Inc.
603 +
604 +# This program is free software: you can redistribute it and/or modify
605 +# it under the terms of the GNU General Public License as published by
606 +# the Free Software Foundation, either version 3 of the License, or
607 +# (at your option) any later version.
608 +
609 +# This program is distributed in the hope that it will be useful,
610 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
611 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
612 +# GNU General Public License for more details.
613 +
614 +# You should have received a copy of the GNU General Public License
615 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
616 +
617 +
618 +# List the specified version-controlled files.
619 +# With no argument, list them all.  With a single DIRECTORY argument,
620 +# list the version-controlled files in that directory.
621 +
622 +# If there's an argument, it must be a single, "."-relative directory name.
623 +# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
624 +
625 +postprocess=
626 +case $1 in
627 +  --help) cat <<EOF
628 +Usage: $0 [-C SRCDIR] [DIR]
629 +
630 +Output a list of version-controlled files in DIR (default .), relative to
631 +SRCDIR (default .).  SRCDIR must be the top directory of a checkout.
632 +
633 +Options:
634 +  --help     print this help, then exit
635 +  --version  print version number, then exit
636 +  -C SRCDIR  change directory to SRCDIR before generating list
637 +
638 +Report bugs and patches to <bug-gnulib@gnu.org>.
639 +EOF
640 +    exit ;;
641 +
642 +  --version)
643 +    year=`echo "$scriptversion" | sed 's/[^0-9].*//'`
644 +    cat <<EOF
645 +vc-list-files $scriptversion
646 +Copyright (C) $year Free Software Foundation, Inc,
647 +License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
648 +This is free software: you are free to change and redistribute it.
649 +There is NO WARRANTY, to the extent permitted by law.
650 +EOF
651 +    exit ;;
652 +
653 +  -C)
654 +    test "$2" = . || postprocess="| sed 's|^|$2/|'"
655 +    cd "$2" || exit 1
656 +    shift; shift ;;
657 +esac
658 +
659 +dir=
660 +case $# in
661 +  0) ;;
662 +  1) dir=$1 ;;
663 +  *) echo "$0: too many arguments" 1>&2
664 +     echo "Usage: $0 [-C srcdir] [DIR]" 1>&2; exit 1;;
665 +esac
666 +
667 +test "x$dir" = x && dir=.
668 +
669 +if test -d .git; then
670 +  eval exec git ls-files '"$dir"' $postprocess
671 +elif test -d .hg; then
672 +  eval exec hg locate '"$dir/*"' $postprocess
673 +elif test -d .bzr; then
674 +  test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
675 +  eval exec bzr ls --versioned '"$dir"' $postprocess
676 +elif test -d CVS; then
677 +  test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
678 +  if test -x build-aux/cvsu; then
679 +    eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
680 +  elif (cvsu --help) >/dev/null 2>&1; then
681 +    eval cvsu --find --types=AFGM '"$dir"' $postprocess
682 +  else
683 +    eval awk -F/ \''{                  \
684 +       if (!$1 && $3 !~ /^-/) {        \
685 +         f=FILENAME;                   \
686 +         if (f ~ /CVS\/Entries$/)      \
687 +           f = substr(f, 0, length(f)-11); \
688 +         print f $2;                   \
689 +       }}'\''                          \
690 +      `find "$dir" -name Entries -print` /dev/null' $postprocess
691 +  fi
692 +else
693 +  echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
694 +  exit 1
695 +fi
696 +
697 +# Local variables:
698 +# eval: (add-hook 'write-file-hooks 'time-stamp)
699 +# time-stamp-start: "scriptversion="
700 +# time-stamp-format: "%:y-%02m-%02d.%02H"
701 +# time-stamp-end: "$"
702 +# End: