2
0
mirror of git://git.proxmox.com/git/spiceterm.git synced 2025-08-30 05:38:07 +00:00

exit if spice_server_init fails (socket already in use?)

This commit is contained in:
Dietmar Maurer 2013-08-05 09:56:02 +02:00
parent 08e17e0c30
commit 1d7f2da4a4
3 changed files with 11 additions and 6 deletions

View File

@ -7,3 +7,7 @@ all: ${PROGRAMS}
test_display_no_ssl: ${SOURCES} ${HEADERS}
gcc ${SOURCES} -o $@ $(shell pkg-config --cflags --libs spice-protocol,spice-server)
.PHONY: test
test: test_display_no_ssl
./test_display_no_ssl & remote-viewer spice://localhost:5912

View File

@ -861,7 +861,10 @@ Test *test_new(SpiceCoreInterface *core)
printf("TESTER: listening on port %d (unsecure)\n", port);
spice_server_set_port(server, port);
spice_server_set_noauth(server);
spice_server_init(server, core);
int res = spice_server_init(server, core);
if (res != 0) {
g_error("spice_server_init failed, res = %d\n", res);
}
cursor_init();
path_init(&path, 0, angle_parts);

View File

@ -7,19 +7,17 @@
*/
#include <stdlib.h>
#include <stdio.h>
#include "test_display_base.h"
SpiceCoreInterface *core;
SpiceTimer *ping_timer;
void show_channels(SpiceServer *server);
int ping_ms = 100;
int ping_ms = 1000;
void pinger(void *opaque)
{
// show_channels is not thread safe - fails if disconnections / connections occur
//show_channels(server);
printf("TEST PINGER\n");
core->timer_start(ping_timer, ping_ms);
}