~ubuntu-branches/ubuntu/karmic/italc/karmic-updates

« back to all changes in this revision

Viewing changes to ica/x11/x11vnc/cleanup.c

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Graber
  • Date: 2008-02-11 23:40:20 UTC
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20080211234020-o9fixmzxpa1ybhlq
Tags: upstream-1.0.6
Import upstream version 1.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -- cleanup.c -- */
2
2
 
3
 
#include <stdio.h>
4
3
#include "x11vnc.h"
5
4
#include "xwrappers.h"
6
5
#include "xdamage.h"
13
12
#include "sslcmds.h"
14
13
#include "sslhelper.h"
15
14
#include "connections.h"
 
15
#include "macosx.h"
 
16
#include "macosxCG.h"
 
17
#include "avahi.h"
16
18
 
17
19
/*
18
20
 * Exiting and error handling routines
87
89
                        break;
88
90
                }
89
91
        }
90
 
        if (!quiet) {
 
92
        if (!quiet && cnt > 0) {
91
93
                rfbLog("deleted %d tile_row polling images.\n", cnt);
92
94
        }
93
95
}
128
130
                ssl_helper_pid(0, 0);   /* killall */
129
131
        }
130
132
 
 
133
        if (avahi) {
 
134
                avahi_cleanup();
 
135
        }
 
136
        if (ssh_pid > 0) {
 
137
                kill(ssh_pid, SIGTERM);
 
138
                ssh_pid = 0;
 
139
        }
 
140
 
131
141
#ifdef MACOSX
132
142
        if (client_connect_file) {
133
 
                if (strstr(client_connect_file, "/tmp/x11vnc-macosx-channel.")
 
143
                if (strstr(client_connect_file, "/tmp/x11vnc-macosx-remote")
134
144
                    == client_connect_file) {
135
145
                        unlink(client_connect_file);
136
146
                }
149
159
                clear_modifiers(0);
150
160
        } else if (clear_mods == 2) {
151
161
                clear_keys();
 
162
        } else if (clear_mods == 3) {
 
163
                clear_keys();
 
164
                clear_locks();
152
165
        }
153
166
 
154
167
        if (no_autorepeat) {
157
170
        if (use_solid_bg) {
158
171
                solid_bg(1);
159
172
        }
 
173
        if (ncache || ncache0) {
 
174
                kde_no_animate(1);
 
175
        }
160
176
        X_LOCK;
161
177
        XTestDiscard_wr(dpy);
162
178
#if LIBVNCSERVER_HAVE_LIBXDAMAGE
360
376
static void interrupted (int sig) {
361
377
        exit_sig = sig;
362
378
        if (exit_flag) {
 
379
                fprintf(stderr, "extra[%d] signal: %d\n", exit_flag, sig);
363
380
                exit_flag++;
364
381
                if (use_threads) {
365
382
                        usleep2(250 * 1000);
371
388
        exit_flag++;
372
389
        if (sig == 0) {
373
390
                fprintf(stderr, "caught X11 error:\n");
 
391
                if (crash_debug) { crash_shell(); }
374
392
        } else if (sig == -1) {
375
393
                fprintf(stderr, "caught XIO error:\n");
376
394
        } else {
381
399
                return;
382
400
        }
383
401
 
 
402
        if (crash_debug) {
 
403
                crash_shell();
 
404
        }
 
405
 
384
406
        X_UNLOCK;
385
407
 
386
408
        if (icon_mode) {
401
423
                clear_modifiers(0);
402
424
        } else if (clear_mods == 2) {
403
425
                clear_keys();
 
426
        } else if (clear_mods == 3) {
 
427
                clear_keys();
 
428
                clear_locks();
404
429
        }
405
430
        if (no_autorepeat) {
406
431
                autorepeat(1, 0);
408
433
        if (use_solid_bg) {
409
434
                solid_bg(1);
410
435
        }
 
436
        if (ncache || ncache0) {
 
437
                kde_no_animate(1);
 
438
        }
411
439
        stop_stunnel();
412
440
 
413
441
        if (crash_debug) {