changeset 49387:3875d7b926a8

8199323: hsdis could not be loaded which are located on long path Reviewed-by: dholmes, stuefe
author ysuenaga
date Wed, 14 Mar 2018 00:30:56 +0900
parents 02e78f38e7d0
children bf2ff45e592f
files src/jdk.hotspot.agent/share/native/libsaproc/sadis.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c	Tue Mar 13 11:29:30 2018 +0100
+++ b/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c	Wed Mar 14 00:30:56 2018 +0900
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -64,6 +64,14 @@
 #include <errno.h>
 
 #ifdef _WINDOWS
+#define JVM_MAXPATHLEN _MAX_PATH
+#else
+#include <sys/param.h>
+#define JVM_MAXPATHLEN MAXPATHLEN
+#endif
+
+
+#ifdef _WINDOWS
 static int getLastErrorString(char *buf, size_t len)
 {
     long errval;
@@ -112,7 +120,7 @@
   const char *error_message = NULL;
   const char *jrepath = NULL;
   const char *libname = NULL;
-  char buffer[128];
+  char buffer[JVM_MAXPATHLEN];
 
 #ifdef _WINDOWS
   HINSTANCE hsdis_handle = (HINSTANCE) NULL;