src/solaris/native/sun/awt/awt_LoadLibrary.c

Print this page

        

@@ -108,11 +108,11 @@
 
     fmProp = (*env)->NewStringUTF(env, "sun.font.fontmanager");
     /* Check if toolkit is specified in env variable */
 #ifdef MACOSX
     envvar = getenv("AWT_TOOLKIT");
-    if (envvar && strstr(envvar, "XToolkit")) {
+    if ((envvar && strstr(envvar, "XToolkit")) || AWTIsHeadless()) {
 #endif
         fmanager = (*env)->NewStringUTF(env, "sun.awt.X11FontManager");
         tk = "/xawt/libmawt";
 #ifdef MACOSX
     } else {

@@ -125,19 +125,15 @@
                                    "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
                                    fmProp, fmanager);
     }
 
     /* Calculate library name to load */
-#ifndef MACOSX
     if (AWTIsHeadless()) {
         strcpy(p, "/headless/libmawt");
     } else if (tk) {
-#endif
         strcpy(p, tk);
-#ifndef MACOSX
     }
-#endif
 
 #ifdef MACOSX
     strcat(p, ".dylib");
 #else
     strcat(p, ".so");