File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1234,6 +1234,7 @@ int MKDirpSync(uv_loop_t* loop,
1234
1234
}
1235
1235
break ;
1236
1236
case UV_EACCES:
1237
+ case UV_ENOTDIR:
1237
1238
case UV_EPERM: {
1238
1239
return err;
1239
1240
}
@@ -1309,6 +1310,7 @@ int MKDirpAsync(uv_loop_t* loop,
1309
1310
break ;
1310
1311
}
1311
1312
case UV_EACCES:
1313
+ case UV_ENOTDIR:
1312
1314
case UV_EPERM: {
1313
1315
req_wrap->continuation_data ()->Done (err);
1314
1316
break ;
@@ -1351,7 +1353,6 @@ int MKDirpAsync(uv_loop_t* loop,
1351
1353
}
1352
1354
// verify that the path pointed to is actually a directory.
1353
1355
if (err == 0 && !S_ISDIR (req->statbuf .st_mode )) err = UV_EEXIST;
1354
- uv_fs_req_cleanup (req);
1355
1356
req_wrap->continuation_data ()->Done (err);
1356
1357
}});
1357
1358
if (err < 0 ) req_wrap->continuation_data ()->Done (err);
Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ function nextdir() {
148
148
message : / E N O T D I R : .* m k d i r / ,
149
149
name : 'Error' ,
150
150
syscall : 'mkdir' ,
151
+ path : pathname // See: https://github.com/nodejs/node/issues/28015
151
152
}
152
153
) ;
153
154
}
@@ -187,6 +188,11 @@ function nextdir() {
187
188
assert . strictEqual ( err . code , 'ENOTDIR' ) ;
188
189
assert . strictEqual ( err . syscall , 'mkdir' ) ;
189
190
assert . strictEqual ( fs . existsSync ( pathname ) , false ) ;
191
+ // See: https://github.com/nodejs/node/issues/28015
192
+ // The path field varies slightly in Windows errors, vs., other platforms
193
+ // see: https://github.com/libuv/libuv/issues/2661, for this reason we
194
+ // use startsWith() rather than comparing to the full "pathname".
195
+ assert ( err . path . startsWith ( filename ) ) ;
190
196
} ) ) ;
191
197
}
192
198
You can’t perform that action at this time.
0 commit comments