Skip to content

Commit

Permalink
pass hotspot attach
Browse files Browse the repository at this point in the history
  • Loading branch information
chaolihf committed Feb 13, 2024
1 parent 9cd38d6 commit 75c89fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/cgo/jattach.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ static int write_command(int fd, char * command, char* arguments) {
char* p = stpncpy(buf, "1", sizeof(buf)) + 1;

p = stpncpy(p, command, limit - p) + 1;
char * space=" ";
p = stpncpy(p, space, limit - p) + 1;
p = stpncpy(p, arguments, limit - p) + 1;
for (;p < limit; ) {
//char* space=" ";
//p = stpncpy(p, space, limit - p) + 1;
//p = stpncpy(p, arguments, limit - p) + 1;
for (int i=1;i<4 && p < limit;i++ ) {
*p++ = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cgo/jattach_test.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "jattach.c"

int main(int argc,char ** argv){
jattach(18826,"1","2",0);
jattach(78596,"threaddump","",1);
return 0;
}

0 comments on commit 75c89fc

Please sign in to comment.