Index: /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/logging/JavaConsole.java
===================================================================
--- /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/logging/JavaConsole.java	(revision 435)
+++ /trunk/icedtea-web/netx/net/sourceforge/jnlp/util/logging/JavaConsole.java	(revision 436)
@@ -51,4 +51,5 @@
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.Charset;
@@ -535,13 +536,14 @@
     }
 
-    public void createPluginReader(final File file) {
-        OutputController.getLogger().log("Starting processing of plugin-debug-to-console " + file.getAbsolutePath());
+    public void createPluginReader(final InputStream inputstream) {
+        OutputController.getLogger().log("Starting processing of plugin-debug-to-console " + inputstream);
         Thread t = new Thread(new Runnable() {
 
             @Override
             public void run() {
+                OutputController.getLogger().log("Started processing of plugin-debug-to-console " + inputstream);
                 BufferedReader br = null;
                 try {
-                    br = new BufferedReader(new InputStreamReader(new FileInputStream(file),
+                    br = new BufferedReader(new InputStreamReader(inputstream,
                             Charset.forName("UTF-8")));
                     //never ending loop
@@ -567,11 +569,18 @@
                     }
                 }
-                OutputController.getLogger().log("Ended processing of plugin-debug-to-console " + file.getAbsolutePath());
+                OutputController.getLogger().log("Ended processing of plugin-debug-to-console " + inputstream);
             }
         }, "plugin-debug-to-console reader thread");
         t.setDaemon(true);
         t.start();
-
-        OutputController.getLogger().log("Started processing of plugin-debug-to-console " + file.getAbsolutePath());
+    }
+
+    public void createPluginReader(final File file) {
+        OutputController.getLogger().log("Starting processing of plugin-debug-to-console " + file.getAbsolutePath());
+        try {
+            createPluginReader(new FileInputStream(file));
+        } catch (Exception ex) {
+            OutputController.getLogger().log(ex);
+        }
     }
 }
Index: /trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc
===================================================================
--- /trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc	(revision 435)
+++ /trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc	(revision 436)
@@ -173,6 +173,10 @@
 #endif
 
+#ifdef __OS2__
+int debug_pipe[2] = { -1 };
+#else
 // Applet viewer debug pipe name.
 gchar* debug_pipe_name = NULL;
+#endif
 
 // Applet viewer output watch source.
@@ -588,4 +592,13 @@
   initialize_debug();//should be already initialized, but...
   if (plugin_debug_to_console){
+#ifdef __OS2__
+    if (socketpair (AF_LOCAL, SOCK_STREAM, 0, debug_pipe) == -1)
+      {
+        PLUGIN_ERROR ("Failed to create debug pipe", strerror (errno));
+        np_error = NPERR_GENERIC_ERROR;
+        goto cleanup_debug_pipe;
+      }
+    PLUGIN_DEBUG ("ITNP_New: created debug fifo: %d/%d\n", debug_pipe [0], debug_pipe [1]);
+#else
     // debug_pipe_name
     debug_pipe_name = g_strdup_printf ("%s/%d-icedteanp-plugin-debug-to-appletviewer",
@@ -610,4 +623,5 @@
       }
     PLUGIN_DEBUG ("ITNP_New: created debug fifo: %s\n", debug_pipe_name);
+#endif
   }
 
@@ -622,4 +636,6 @@
   fcntl (in_pipe [0], F_SETFD, FD_CLOEXEC);
   fcntl (out_pipe [0], F_SETFD, FD_CLOEXEC);
+  if (plugin_debug_to_console)
+    fcntl (debug_pipe [0], F_SETFD, FD_CLOEXEC);
 #endif
 
@@ -630,4 +646,6 @@
   CLOSE_FD (in_pipe [1]);
   CLOSE_FD (out_pipe [1]);
+  if (plugin_debug_to_console)
+    CLOSE_FD (debug_pipe [1]);
 #endif
 
@@ -698,6 +716,10 @@
   // debug_to_appletviewer
   if (plugin_debug_to_console){
+#ifdef __OS2__
+    debug_to_appletviewer = g_io_channel_unix_new (debug_pipe [0]);
+#else
     debug_to_appletviewer = g_io_channel_new_file (debug_pipe_name,
                                                  "w", &channel_error);
+#endif
     if (!debug_to_appletviewer)
       {
@@ -754,4 +776,11 @@
   out_to_appletviewer = NULL;
 
+#ifdef __OS2__
+ cleanup_debug_pipe:
+  if (plugin_debug_to_console){
+    CLOSE_FD (debug_pipe [0]);
+    CLOSE_FD (debug_pipe [1]);
+  }
+#else
   if (plugin_debug_to_console){
     // cleanup_debug_pipe:
@@ -766,6 +795,5 @@
     debug_pipe_name = NULL;
   }
-
-
+#endif
 
   // cleanup_out_pipe:
@@ -1636,11 +1664,13 @@
   command_line.push_back(static_cast<std::ostringstream &>(std::ostringstream() << out_pipe[1]).str());
   command_line.push_back(static_cast<std::ostringstream &>(std::ostringstream() << in_pipe[1]).str());
+  if (plugin_debug_to_console)
+    command_line.push_back(static_cast<std::ostringstream &>(std::ostringstream() << debug_pipe[1]).str());
 #else
   command_line.push_back(out_pipe_name);
   command_line.push_back(in_pipe_name);
-#endif
   if (plugin_debug_to_console){
       command_line.push_back(debug_pipe_name);
   }
+#endif
 
   // Finished command line parameters
@@ -2440,4 +2470,8 @@
     out_to_appletviewer = NULL;
     // cleanup_debug_pipe:
+#ifdef __OS2__
+    CLOSE_FD (debug_pipe [0]);
+    CLOSE_FD (debug_pipe [1]);
+#else
     // Delete debug pipe.
     PLUGIN_DEBUG ("NP_Shutdown: deleting debug fifo: %s\n", debug_pipe_name);
@@ -2447,4 +2481,5 @@
     g_free (debug_pipe_name);
     debug_pipe_name = NULL;
+#endif
   }
   
Index: /trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.h
===================================================================
--- /trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.h	(revision 435)
+++ /trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.h	(revision 436)
@@ -134,5 +134,9 @@
 extern FILE * plugin_file_log;
 extern std::string plugin_file_log_name;
+#ifdef __OS2__
+extern int debug_pipe[2];
+#else
 extern gchar* debug_pipe_name;
+#endif
 
 extern gboolean jvm_up;
Index: /trunk/icedtea-web/plugin/icedteanp/IcedTeaPluginUtils.cc
===================================================================
--- /trunk/icedtea-web/plugin/icedteanp/IcedTeaPluginUtils.cc	(revision 435)
+++ /trunk/icedtea-web/plugin/icedteanp/IcedTeaPluginUtils.cc	(revision 436)
@@ -1207,4 +1207,9 @@
         } 
         if (plugin_debug_to_console){ 
+#ifdef __OS2__
+          if (debug_pipe[0] != -1){
+            PLUGIN_DEBUG("plugin_debug_to_console: true, pipe %d\n", debug_pipe[0]);
+          }
+#else
           if (debug_pipe_name){
             PLUGIN_DEBUG("plugin_debug_to_console: true, pipe %s\n", debug_pipe_name);
@@ -1212,4 +1217,5 @@
             PLUGIN_DEBUG("plugin_debug_to_console: true, pipe not yet known or broken\n");
           }
+#endif
         } else {
           PLUGIN_DEBUG("plugin_debug_to_console: false\n"); 
Index: /trunk/icedtea-web/plugin/icedteanp/os2/java/sun/applet/PluginMainBase.java
===================================================================
--- /trunk/icedtea-web/plugin/icedteanp/os2/java/sun/applet/PluginMainBase.java	(revision 435)
+++ /trunk/icedtea-web/plugin/icedteanp/os2/java/sun/applet/PluginMainBase.java	(revision 436)
@@ -52,4 +52,5 @@
     private static int inPipe = -1;
     private static int outPipe = -1;
+    private static int debugPipe = -1;
 
     static boolean checkArgs(String args[]) {
@@ -60,8 +61,6 @@
                 DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched();
                 if (JavaConsole.isEnabled()) {
-                    if ((args.length < 3) || !new File(args[2]).exists()) {
+                    if ((args.length < 3) || (debugPipe = Integer.valueOf(args[2]).intValue()) < 0) {
                         OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Warning, although console is on, plugin debug connection do not exists. No plugin information will be displayed in console (only java ones).");
-                    } else {
-                        JavaConsole.getConsole().createPluginReader(new File(args[2]));
                     }
                 }
@@ -81,4 +80,9 @@
         fdAccess.set(outPipeFD, outPipe);
         streamHandler = new PluginStreamHandler(new FileInputStream(inPipeFD), new FileOutputStream(outPipeFD));
+        if (JavaConsole.isEnabled() && debugPipe != -1) {
+            FileDescriptor debugPipeFD = new FileDescriptor();
+            fdAccess.set(debugPipeFD, debugPipe);
+            JavaConsole.getConsole().createPluginReader(new FileInputStream(debugPipeFD));
+        }
         PluginDebug.debug("Streams initialized");
         return streamHandler;
