Print this page


Split Close
Expand all
Collapse all
          --- old/src/solaris/native/sun/awt/awt_LoadLibrary.c
          +++ new/src/solaris/native/sun/awt/awt_LoadLibrary.c
↓ open down ↓ 97 lines elided ↑ open up ↑
  98   98      jvm = vm;
  99   99  
 100  100      /* Get address of this library and the directory containing it. */
 101  101      dladdr((void *)JNI_OnLoad, &dlinfo);
 102  102      realpath((char *)dlinfo.dli_fname, buf);
 103  103      len = strlen(buf);
 104  104      p = strrchr(buf, '/');
 105  105  
 106  106      /*
 107  107       * The code below is responsible for:
 108      -     * 1. Loading appropriate awt library, i.e. xawt/libmawt or headless/libwawt
      108 +     * 1. Loading appropriate awt library, i.e. libawt_xawt or libawt_headless
 109  109       * 2. Setting "awt.toolkit" system property to use the appropriate Java toolkit class,
 110  110       *    (if user has specified the toolkit in env varialble)
 111  111       */
 112  112  
 113  113      propname = (*env)->NewStringUTF(env, "awt.toolkit");
 114  114      /* Check if toolkit is specified in env variable */
 115  115      envvar = getenv("AWT_TOOLKIT");
 116  116      if (envvar) {
 117  117          if (strstr(envvar, "XToolkit")) {
 118  118              toolkit = (*env)->NewStringUTF(env, "sun.awt.X11.XToolkit");
↓ open down ↓ 4 lines elided ↑ open up ↑
 123  123                                          NULL,
 124  124                                          "java/lang/System",
 125  125                                          "setProperty",
 126  126                                          "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
 127  127                                          propname,toolkit);
 128  128          }
 129  129      }
 130  130  
 131  131      /* Calculate library name to load */
 132  132      if (AWTIsHeadless()) {
 133      -        strncpy(p, "/headless/libmawt.so", MAXPATHLEN-len-1);
      133 +        strncpy(p, "/libawt_headless.so", MAXPATHLEN-len-1);
 134  134      } else {
 135  135          /* Default AWT Toolkit on Linux and Solaris is XAWT. */
 136      -        strncpy(p, "/xawt/libmawt.so", MAXPATHLEN-len-1);
      136 +        strncpy(p, "/libawt_xawt.so", MAXPATHLEN-len-1);
 137  137      }
 138  138  
 139  139      if (toolkit) {
 140  140          (*env)->DeleteLocalRef(env, toolkit);
 141  141      }
 142  142      if (propname) {
 143  143          (*env)->DeleteLocalRef(env, propname);
 144  144      }
 145  145  
 146  146      JNU_CallStaticMethodByName(env, NULL, "java/lang/System", "load",
↓ open down ↓ 121 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX