Use stderr File directly
authorMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 28 Oct 2006 08:34:21 +0000 (08:34 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 28 Oct 2006 08:34:21 +0000 (08:34 +0000)
mmsoftware/js/js-appserv/app/test/main.js

index ed3d125..7c013d6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: main.js,v 1.1 2006/08/20 06:58:57 mmondor Exp $ */
+/* $Id: main.js,v 1.2 2006/10/28 08:34:21 mmondor Exp $ */
 
 /*
  * Copyright (C) 2006, Matthew Mondor
@@ -91,12 +91,6 @@ sid_expiration = 30;
 
 
 
-/* Set err globally */
-err = new FD();
-err.set(FD.STDERR_FILENO);
-
-
-
 function file_read(file)
 {
        var contents = '';
@@ -113,7 +107,7 @@ function file_read(file)
                        contents += data;
                }
        } catch (x) {
-               err.put(x + "\n");
+               stderr.write(x + "\n");
        } finally {
                fd.close();
        }
@@ -143,7 +137,7 @@ function child_init_hook()
                /* Set pgc globally */
                pgc = PG.connectDb(database);
        } catch (x) {
-               err.put(x + "\n");
+               stderr.write(x + "\n");
        }
        sid_init();
 }
@@ -176,14 +170,14 @@ function reject_handler(r, reason)
                fd = new FD();
                fd.binit(r.client_socket, hello_timeout, hello_timeout);
        } catch (x) {
-               err.put(x + "\n");
+               stderr.write(x + "\n");
        }
 
        try {
                o = {result: false, msg: "Rejected", reason: reason};
                fd.put(o.toSource() + "\r\n");
        } catch (x) {
-               err.put(x + "\n");
+               stderr.write(x + "\n");
        }
 }
 
@@ -222,7 +216,7 @@ function request_handler(r)
                fd = new FD();
                fd.binit(r.client_socket, hello_timeout, hello_timeout);
        } catch (x) {
-               err.put(x + "\n");
+               stderr.write(x + "\n");
        }
 
        o = {result: true, msg: "Ready"};