Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (C) Igor Sysoev
*/
#include <stddef.h> /* offsetof() */
#ifndef _NGX_QUEUE_H_INCLUDED_
#define _NGX_QUEUE_H_INCLUDED_
We couldn’t find that file to show.
/* Copyright (c) 2009 Ryan Dahl <ry@tinyclouds.org>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@ry
ry / gist:249750
Created December 5, 2009 16:33 — forked from felixge/gist:249748
db.query('SELECT 1')
('result1', function(result1) {
return db.query('SELECT 2');
})
('result2', function(result2) {
return db.query('SELECT 3');
})
('result3')
.addCallback(function(results) {
p(results); // == {result1: result1, result2: result2, result3: result}
cloth 0 ~/projects/node > git diff --stat $(git rev-list -1 --until="5 hours ago" HEAD) -- **/*.js
lib/dns.js | 48 +++++-
lib/sys.js | 8 +-
src/node.js | 331 ++++++++++++++++++++++++++++++-------
test/mjsunit/disabled/test-dns.js | 29 ++++
4 files changed, 350 insertions(+), 66 deletions(-)
cloth 0 ~/projects/node > git diff --stat $(git rev-list -1 --until="5 hours ago" HEAD) -- **/*.{cc,h}
src/node.cc | 1 -
src/node_dns.cc | 94 ++++++++++----
src/node_events.cc | 138 --------------------
diff --git a/src/node.js b/src/node.js
index c8f55c6..c0cd5db 100644
--- a/src/node.js
+++ b/src/node.js
@@ -536,6 +536,7 @@ var posixModule = createInternalModule("posix", function (exports) {
exports.read = function (fd, length, position, encoding) {
var promise = new process.Promise()
+ encoding = encoding | "binary";
process.fs.read(fd, length, position, encoding, callback(promise));
diff --git a/src/node.js b/src/node.js
index 69416d0..4ba4432 100644
--- a/src/node.js
+++ b/src/node.js
@@ -71,6 +71,8 @@ node.inherits = function () {
};
+var childProcesses = [];
+
bpt-dmz 0 ~/node/stdin_issue > cat sub.js
var sys = require("../lib/sys");
process.stdio.open();
process.stdio.addListener("data", function (data) {
sys.puts("child: " + data);
});
bpt-dmz 0 ~/node/stdin_issue > cat test.js
var sys = require("../lib/sys");
var path = require('path');
var sub = path.join(path.dirname(__filename), 'sub.js');
function loadConfig() {
return posix
.cat('config.json')
(true, function(config) {
return (config instanceof Error)
? posix.cat('configuration.json')
: config;
})
(function() {
return JSON.parse(config);
function loadConfig() {
return posix.cat('config.json')(function(error, config) {
return posix.cat('configuration.json')
})(function(error, config) {
if (error) {
sys.puts("Can't load config");
// if there is an error then it has to be returned
// otherwise the error is thrown
return error;
}