jdk/src/solaris/native/java/lang/java_props_md.c
changeset 11665 98dad53a8ba1
parent 9002 6ee0abf0167f
child 12047 320a714614e9
equal deleted inserted replaced
11664:5e4b10294666 11665:98dad53a8ba1
   308 
   308 
   309     return 1;
   309     return 1;
   310 }
   310 }
   311 
   311 
   312 #ifdef JAVASE_EMBEDDED
   312 #ifdef JAVASE_EMBEDDED
   313 /* Determine the default embedded toolkit based on whether lib/xawt/
   313 /* Determine the default embedded toolkit based on whether libawt_xawt
   314  * exists in the JRE. This can still be overridden by -Dawt.toolkit=XXX
   314  * exists in the JRE. This can still be overridden by -Dawt.toolkit=XXX
   315  */
   315  */
   316 static char* getEmbeddedToolkit() {
   316 static char* getEmbeddedToolkit() {
   317     Dl_info dlinfo;
   317     Dl_info dlinfo;
   318     char buf[MAXPATHLEN];
   318     char buf[MAXPATHLEN];
   323     /* Get address of this library and the directory containing it. */
   323     /* Get address of this library and the directory containing it. */
   324     dladdr((void *)getEmbeddedToolkit, &dlinfo);
   324     dladdr((void *)getEmbeddedToolkit, &dlinfo);
   325     realpath((char *)dlinfo.dli_fname, buf);
   325     realpath((char *)dlinfo.dli_fname, buf);
   326     len = strlen(buf);
   326     len = strlen(buf);
   327     p = strrchr(buf, '/');
   327     p = strrchr(buf, '/');
   328     /* Default AWT Toolkit on Linux and Solaris is XAWT. */
   328     /* Default AWT Toolkit on Linux and Solaris is XAWT (libawt_xawt.so). */
   329     strncpy(p, "/xawt/", MAXPATHLEN-len-1);
   329     strncpy(p, "/libawt_xawt.so", MAXPATHLEN-len-1);
   330     /* Check if it exists */
   330     /* Check if it exists */
   331     if (stat(buf, &statbuf) == -1 && errno == ENOENT) {
   331     if (stat(buf, &statbuf) == -1 && errno == ENOENT) {
   332         /* No - this is a reduced-headless-jre so use special HToolkit */
   332         /* No - this is a reduced-headless-jre so use special HToolkit */
   333         return "sun.awt.HToolkit";
   333         return "sun.awt.HToolkit";
   334     }
   334     }