@@ -86,11 +86,14 @@ static void After(uv_fs_t *req) {
8686 if (req->result == -1 ) {
8787 // If the request doesn't have a path parameter set.
8888
89- // XXX if (!req->arg0 ) {
89+ if (!req->path ) {
9090 argv[0 ] = ErrnoException (req->errorno );
91- // XXX } else {
92- // XXX argv[0] = ErrnoException(req->errorno, NULL, "", static_cast<const char*>(req->arg0));
93- // XXX}
91+ } else {
92+ argv[0 ] = ErrnoException (req->errorno ,
93+ NULL ,
94+ " " ,
95+ static_cast <const char *>(req->path ));
96+ }
9497 } else {
9598 // error value is empty or null for non-error.
9699 argv[0 ] = Local<Value>::New (Null ());
@@ -214,7 +217,7 @@ struct fs_req_wrap {
214217#define SYNC_CALL (func, path, ...) \
215218 fs_req_wrap req_wrap; \
216219 uv_fs_##func(uv_default_loop(), &req_wrap.req, __VA_ARGS__, NULL ); \
217- if (req_wrap.req.result == - 1 ) { \
220+ if (req_wrap.req.result < 0 ) { \
218221 return ThrowException ( \
219222 ErrnoException (req_wrap.req .errorno , #func, " " , path)); \
220223 }
@@ -334,7 +337,7 @@ static Handle<Value> Stat(const Arguments& args) {
334337 if (args[1 ]->IsFunction ()) {
335338 ASYNC_CALL (stat, args[1 ], *path)
336339 } else {
337- SYNC_CALL (stat, 0 , *path)
340+ SYNC_CALL (stat, *path , *path)
338341 return scope.Close (BuildStatsObject ((NODE_STAT_STRUCT*)SYNC_REQ.ptr ));
339342 }
340343}
0 commit comments