qrexec-daemon: check symlink success

This commit is contained in:
Vincent Penquerc'h 2014-01-12 06:41:27 -05:00 committed by Marek Marczykowski-Górecki
parent 63c46b2f8c
commit 4a81560536

View File

@ -97,7 +97,10 @@ int create_qrexec_socket(int domid, const char *domname)
snprintf(link_to_socket_name, sizeof link_to_socket_name, snprintf(link_to_socket_name, sizeof link_to_socket_name,
QREXEC_DAEMON_SOCKET_DIR "/qrexec.%s", domname); QREXEC_DAEMON_SOCKET_DIR "/qrexec.%s", domname);
unlink(link_to_socket_name); unlink(link_to_socket_name);
symlink(socket_address, link_to_socket_name); if (symlink(socket_address, link_to_socket_name)) {
fprintf(stderr, "symlink(%s,%s) failed: %s\n", socket_address,
link_to_socket_name, strerror (errno));
}
return get_server_socket(socket_address); return get_server_socket(socket_address);
} }