X-Git-Url: http://git.sven.stormbind.net/?p=sven%2Fjattach.git;a=blobdiff_plain;f=src%2Fposix%2Fjattach_openj9.c;fp=src%2Fposix%2Fjattach_openj9.c;h=deab4c68f150f041844e1c25de6aaed4a22b602d;hp=f34f4cc79447eec298f021df132235d4f2a444ba;hb=98ce3928a99273b631c525a81df022e6f8ec46a7;hpb=91eb05a0b9cfabc7670a4f0f1e2b8083307a2fca diff --git a/src/posix/jattach_openj9.c b/src/posix/jattach_openj9.c index f34f4cc..deab4c6 100644 --- a/src/posix/jattach_openj9.c +++ b/src/posix/jattach_openj9.c @@ -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; }