Skip to content

Process always exits with exit code 0 #182

@Grepsy

Description

@Grepsy

The process never ends with an exit code other then 0, it seems the code in the 'drain' event is never executed because node exits before the event is fired. Should we block and wait for the event?

quit: function(code){
    //Workaround for https://github.com/joyent/node/issues/1669
    var flushed = process.stdout.flush();
    if (!flushed) {
        fs.writeSync(1, 'executes' + "\n");
        process.once("drain", function () {
            fs.writeSync(1, 'never executes' + "\n");
            process.exit(code || 0);
        });
    } else {
        fs.writeSync(1, 'never executes' + "\n");
        process.exit(code || 0);
    }
},

This is caused by the change in issue #176.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions