]> git.sven.stormbind.net Git - sven/jattach.git/blobdiff - src/posix/jattach_openj9.c
New upstream version 2.1
[sven/jattach.git] / src / posix / jattach_openj9.c
index f34f4cc79447eec298f021df132235d4f2a444ba..deab4c68f150f041844e1c25de6aaed4a22b602d 100644 (file)
@@ -273,7 +273,8 @@ static int write_reply_info(int pid, int port, unsigned long long key) {
     }
 
     int chars = snprintf(path, sizeof(path), "%016llx\n%d\n", key, port);
-    write(fd, path, chars);
+    ssize_t r = write(fd, path, chars);
+    (void)r;
     close(fd);
 
     return 0;
@@ -327,6 +328,10 @@ static int accept_client(int s, unsigned long long key) {
         return -1;
     }
 
+    // Reset the timeout, as the command execution may take arbitrary long time
+    struct timeval tv0 = {0, 0};
+    setsockopt(client, SOL_SOCKET, SO_RCVTIMEO, &tv0, sizeof(tv0));
+
     return client;
 }