comparison src/os/bsd/vm/attachListener_bsd.cpp @ 11174:52dd54de4e74

avoid using deprecated stat64 on Mac OS X http://mail.openjdk.java.net/pipermail/hotspot-dev/2013-July/010394.html
author Doug Simon <doug.simon@oracle.com>
date Thu, 01 Aug 2013 00:35:13 +0200
parents 2e8f19c2feef
children
comparison
equal deleted inserted replaced
11173:6b0fd0964b87 11174:52dd54de4e74
443 // an attaching process to think we are ready to receive on the 443 // an attaching process to think we are ready to receive on the
444 // domain socket before we are properly initialized 444 // domain socket before we are properly initialized
445 445
446 void AttachListener::vm_start() { 446 void AttachListener::vm_start() {
447 char fn[UNIX_PATH_MAX]; 447 char fn[UNIX_PATH_MAX];
448 struct stat64 st; 448 struct stat st;
449 int ret; 449 int ret;
450 450
451 int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d", 451 int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
452 os::get_temp_directory(), os::current_process_id()); 452 os::get_temp_directory(), os::current_process_id());
453 assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow"); 453 assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
454 454
455 RESTARTABLE(::stat64(fn, &st), ret); 455 RESTARTABLE(::stat(fn, &st), ret);
456 if (ret == 0) { 456 if (ret == 0) {
457 ret = ::unlink(fn); 457 ret = ::unlink(fn);
458 if (ret == -1) { 458 if (ret == -1) {
459 debug_only(warning("failed to remove stale attach pid file at %s", fn)); 459 debug_only(warning("failed to remove stale attach pid file at %s", fn));
460 } 460 }