mirror of
git://git.proxmox.com/git/spiceterm.git
synced 2025-08-30 13:48:07 +00:00
exit if spice_server_init fails (socket already in use?)
This commit is contained in:
4
Makefile
4
Makefile
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user