From: Luke Kenneth Casson Leighton Date: Thu, 8 Apr 2021 14:06:34 +0000 (+0100) Subject: try to get disconnect to close socket, ah well X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4898fdb7b00660281514fa7a7de2403e8145849c;p=soc-cxxrtl-sim.git try to get disconnect to close socket, ah well --- diff --git a/small_jtag_test/main.cpp b/small_jtag_test/main.cpp index ed7a2a6..7859f64 100644 --- a/small_jtag_test/main.cpp +++ b/small_jtag_test/main.cpp @@ -100,7 +100,12 @@ int read_handler(int fdread, char *buffer) case 0: return 0; // timeout (nothing read) default: - return read(fdread, buffer, 1); + status = read(fdread, buffer, 1); + if (status == -1) { + printf("Error reading on socket\n"); + close(fdread); + } + return status; } }