src/os/bsd/dtrace/jvm_dtrace.c

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 225,235 **** } /* attach to given JVM */ jvm_t* jvm_attach(pid_t pid) { jvm_t* jvm; ! int door_fd, attach_fd, i; jvm = (jvm_t*) calloc(1, sizeof(jvm_t)); if (jvm == NULL) { set_jvm_error(JVM_ERR_OUT_OF_MEMORY); print_debug("calloc failed in %s at %d\n", __FILE__, __LINE__); --- 225,235 ---- } /* attach to given JVM */ jvm_t* jvm_attach(pid_t pid) { jvm_t* jvm; ! int door_fd, attach_fd, i = 0; jvm = (jvm_t*) calloc(1, sizeof(jvm_t)); if (jvm == NULL) { set_jvm_error(JVM_ERR_OUT_OF_MEMORY); print_debug("calloc failed in %s at %d\n", __FILE__, __LINE__);
*** 290,307 **** } /* detach the givenb JVM */ int jvm_detach(jvm_t* jvm) { if (jvm) { ! int res; if (jvm->door_fd != -1) { if (file_close(jvm->door_fd) != 0) { set_jvm_error(JVM_ERR_CANT_CLOSE_DOOR); res = -1; } else { clear_jvm_error(); - res = 0; } } free(jvm); return res; } else { --- 290,306 ---- } /* detach the givenb JVM */ int jvm_detach(jvm_t* jvm) { if (jvm) { ! int res = 0; if (jvm->door_fd != -1) { if (file_close(jvm->door_fd) != 0) { set_jvm_error(JVM_ERR_CANT_CLOSE_DOOR); res = -1; } else { clear_jvm_error(); } } free(jvm); return res; } else {