mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 16:55:46 +00:00

This change is in preparation for lint-enforced brace style. PR-URL: https://github.com/nodejs/node/pull/7630 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
21 lines
541 B
JavaScript
21 lines
541 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var cluster = require('cluster');
|
|
var net = require('net');
|
|
|
|
if (cluster.isMaster) {
|
|
// ensure that the worker exits peacefully
|
|
var worker = cluster.fork();
|
|
worker.on('exit', function(statusCode) {
|
|
assert.equal(statusCode, 0);
|
|
worker = null;
|
|
});
|
|
process.on('exit', function() {
|
|
assert.equal(worker, null);
|
|
});
|
|
} else {
|
|
// listen() without port should not trigger a libuv assert
|
|
net.createServer(common.fail).listen(process.exit);
|
|
}
|