Merge branch 'v0.6'
authorBert Belder <bertbelder@gmail.com>
Thu, 8 Mar 2012 02:14:48 +0000 (03:14 +0100)
committerBert Belder <bertbelder@gmail.com>
Thu, 8 Mar 2012 02:14:48 +0000 (03:14 +0100)
1  2 
deps/uv/include/uv.h
deps/uv/src/unix/error.c
deps/uv/src/win/error.c
doc/api/fs.markdown
src/node_file.cc

Simple merge
index b167f7af1a4d28947913da38369278c4cc9f3a5b,071b03affc5a8ad02da738db09d02ae273e2cccb..b6c4710531a471e9de22c74c7cbbd057f34cd03b
@@@ -88,7 -88,11 +88,9 @@@ uv_err_code uv_translate_sys_error(int 
      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;
    }
 -
 -  assert(0 && "unreachable");
 -  return -1;
 +  UNREACHABLE();
  }
Simple merge
Simple merge
index 3a9877eb58e7fff70cdef23c71eb7390c2501467,645f44532bd2e99ae7b9d9265fc312850f40389e..fe5529d1252db4f473daec7b5c0a67ae70a0a719
@@@ -45,13 -46,21 +45,24 @@@ namespace node 
  using namespace v8;
  
  #define MIN(a,b) ((a) < (b) ? (a) : (b))
 -#define THROW_BAD_ARGS \
 -  ThrowException(Exception::TypeError(String::New("Bad argument")))
 +
 +#define TYPE_ERROR(msg) \
 +    ThrowException(Exception::TypeError(String::New(msg)));
 +
 +#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;
@@@ -208,18 -219,12 +221,18 @@@ 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);                                        \
 -  assert(r == 0);                                                 \
    req_wrap->object_->Set(oncomplete_sym, callback);               \
    req_wrap->Dispatched();                                         \
 +  if (r < 0) {                                                    \
 +    uv_fs_t* req = &req_wrap->req_;                               \
 +    req->result = r;                                              \
 +    req->path = NULL;                                             \
 +    req->errorno = uv_last_error(uv_default_loop()).code;         \
 +    After(req);                                                   \
 +  }                                                               \
    return scope.Close(req_wrap->object_);
  
  #define SYNC_CALL(func, path, ...)                                \