fixed check_port_bind_listen() in
6ae322880b2a6f4de42bd25c9f19ccce870136cd
But one caller of this function was skipped closing socket.
So, this commit adds socket close.
Change-Id: Id204f7e3bd15111019ae86cbacaa75111edd59fd
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
#include <sys/utsname.h>
#include <sys/sysinfo.h>
+#include "qemu/sockets.h"
#include "qemu/error-report.h"
#include "osutil.h"
shm_info.shm_nattch);
if ((shm_info.shm_nattch > 0) &&
g_strcmp0(get_drive_image_file(), (char *)shm_addr) == 0) {
- if (check_port_bind_listen(port + 1) > 0) {
+ int ret = 0;
+ if ((ret = check_port_bind_listen(port + 1)) > 0) {
shmdt(shm_addr);
+ closesocket(ret);
continue;
}
shmdt(shm_addr);