Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'v0.6'
  • Loading branch information
piscisaureus committed Mar 8, 2012
2 parents 5ad0140 + 3733a85 commit 31ad1d2
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 9 deletions.
7 changes: 6 additions & 1 deletion LICENSE
Expand Up @@ -79,8 +79,13 @@ The externally maintained libraries used by Node are:
licensed under a permissive free software license. See
deps/zlib/LICENSE.

- deps/npm npm is a package manager program copyright 2009, 2010, 2011
- deps/npm npm is a package manager program copyright 2009 - 2012
Isaac Z. Schlueter and licensed under MIT. npm includes several
subpackages MIT or Apache licenses, see deps/npm/LICENSE for more
information. npm is included in the Node .msi and .pkg distributions
but not in the Node binary itself.

- tools/doc/node_modules/marked Marked is a Markdown parser Copyright
(c) 2011-2012, Christopher Jeffrey (https://github.com/chjj/). Marked
is used in the generation of node documentation, but not distributed in
any node binaries.
5 changes: 3 additions & 2 deletions deps/uv/include/uv.h
Expand Up @@ -80,7 +80,7 @@ typedef intptr_t ssize_t;
XX( 7, EAFNOSUPPORT, "") \
XX( 8, EALREADY, "") \
XX( 9, EBADF, "bad file descriptor") \
XX( 10, EBUSY, "mount device busy") \
XX( 10, EBUSY, "resource busy or locked") \
XX( 11, ECONNABORTED, "software caused connection abort") \
XX( 12, ECONNREFUSED, "connection refused") \
XX( 13, ECONNRESET, "connection reset by peer") \
Expand Down Expand Up @@ -120,7 +120,8 @@ typedef intptr_t ssize_t;
XX( 49, ENAMETOOLONG, "name too long") \
XX( 50, EPERM, "operation not permitted") \
XX( 51, ELOOP, "too many symbolic links encountered") \
XX( 52, EXDEV, "cross-device link not permitted")
XX( 52, EXDEV, "cross-device link not permitted") \
XX( 53, ENOTEMPTY, "directory not empty")


#define UV_ERRNO_GEN(val, name, s) UV_##name = val,
Expand Down
2 changes: 2 additions & 0 deletions deps/uv/src/unix/error.c
Expand Up @@ -88,6 +88,8 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ESRCH: return UV_ESRCH;
case ETIMEDOUT: return UV_ETIMEDOUT;
case EXDEV: return UV_EXDEV;
case EBUSY: return UV_EBUSY;
case ENOTEMPTY: return UV_ENOTEMPTY;
default: return UV_UNKNOWN;
}
UNREACHABLE();
Expand Down
3 changes: 3 additions & 0 deletions deps/uv/src/win/error.c
Expand Up @@ -78,6 +78,8 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case WSAEAFNOSUPPORT: return UV_EAFNOSUPPORT;
case WSAEWOULDBLOCK: return UV_EAGAIN;
case WSAEALREADY: return UV_EALREADY;
case ERROR_LOCK_VIOLATION: return UV_EBUSY;
case ERROR_SHARING_VIOLATION: return UV_EBUSY;
case ERROR_CONNECTION_ABORTED: return UV_ECONNABORTED;
case WSAECONNABORTED: return UV_ECONNABORTED;
case ERROR_CONNECTION_REFUSED: return UV_ECONNREFUSED;
Expand All @@ -102,6 +104,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_OUTOFMEMORY: return UV_ENOMEM;
case ERROR_NOT_CONNECTED: return UV_ENOTCONN;
case WSAENOTCONN: return UV_ENOTCONN;
case ERROR_DIR_NOT_EMPTY: return UV_ENOTEMPTY;
case ERROR_NOT_SUPPORTED: return UV_ENOTSUP;
case ERROR_INSUFFICIENT_BUFFER: return UV_EINVAL;
case ERROR_INVALID_FLAGS: return UV_EBADF;
Expand Down
3 changes: 1 addition & 2 deletions doc/api/fs.markdown
Expand Up @@ -498,8 +498,7 @@ reliable.

<!--type=misc-->

When watching a directory,
providing `filename` argument in the callback is not supported
Providing `filename` argument in the callback is not supported
on every platform (currently it's only supported on Linux and Windows). Even
on supported platforms `filename` is not always guaranteed to be provided.
Therefore, don't assume that `filename` argument is always provided in the
Expand Down
21 changes: 17 additions & 4 deletions src/node_file.cc
Expand Up @@ -51,7 +51,18 @@ using namespace v8;

#define THROW_BAD_ARGS TYPE_ERROR("Bad argument")

typedef class ReqWrap<uv_fs_t> FSReqWrap;
class FSReqWrap: public ReqWrap<uv_fs_t> {
public:
FSReqWrap(const char* syscall)
: syscall_(syscall) {
}

const char* syscall() { return syscall_; }

private:
const char* syscall_;
};


static Persistent<String> encoding_symbol;
static Persistent<String> errno_symbol;
Expand Down Expand Up @@ -88,11 +99,13 @@ static void After(uv_fs_t *req) {
// If the request doesn't have a path parameter set.

if (!req->path) {
argv[0] = UVException(req->errorno);
} else {
argv[0] = UVException(req->errorno,
NULL,
req_wrap->syscall());
} else {
argv[0] = UVException(req->errorno,
NULL,
req_wrap->syscall(),
static_cast<const char*>(req->path));
}
} else {
Expand Down Expand Up @@ -208,7 +221,7 @@ struct fs_req_wrap {


#define ASYNC_CALL(func, callback, ...) \
FSReqWrap* req_wrap = new FSReqWrap(); \
FSReqWrap* req_wrap = new FSReqWrap(#func); \
int r = uv_fs_##func(uv_default_loop(), &req_wrap->req_, \
__VA_ARGS__, After); \
req_wrap->object_->Set(oncomplete_sym, callback); \
Expand Down
18 changes: 18 additions & 0 deletions tools/doc/LICENSE
@@ -0,0 +1,18 @@
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
20 changes: 20 additions & 0 deletions tools/doc/generate.js
@@ -1,4 +1,24 @@
#!node
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

var marked = require('marked');
var fs = require('fs');
Expand Down
21 changes: 21 additions & 0 deletions tools/doc/html.js
@@ -1,3 +1,24 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

var fs = require('fs');
var marked = require('marked');
var path = require('path');
Expand Down
21 changes: 21 additions & 0 deletions tools/doc/json.js
@@ -1,3 +1,24 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

module.exports = doJSON;

// Take the lexed input, and return a JSON-encoded object
Expand Down

0 comments on commit 31ad1d2

Please sign in to comment.