| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e8b1e2c commit c0cdb83
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -342,6 +342,11 @@ function readFile(path, options, callback) { | |||
| 342 | 342 | return; | |
| 343 | 343 | } | |
| 344 | 344 | ||
| 345 | + if (options.signal?.aborted) { | ||
| 346 | + callback(lazyDOMException('The operation was aborted', 'AbortError')); | ||
| 347 | + return; | ||
| 348 | + } | ||
| 349 | + | ||
| 345 | 350 | const flagsNumber = stringToFlags(options.flag); | |
| 346 | 351 | path = getValidatedPath(path); | |
| 347 | 352 | ||
@@ -1453,7 +1458,13 @@ function lutimesSync(path, atime, mtime) { | |||
| 1453 | 1458 | ||
| 1454 | 1459 | function writeAll(fd, isUserFd, buffer, offset, length, signal, callback) { | |
| 1455 | 1460 | if (signal?.aborted) { | |
| 1456 | - callback(lazyDOMException('The operation was aborted', 'AbortError')); | ||
| 1461 | + if (isUserFd) { | ||
| 1462 | + callback(lazyDOMException('The operation was aborted', 'AbortError')); | ||
| 1463 | + } else { | ||
| 1464 | + fs.close(fd, function() { | ||
| 1465 | + callback(lazyDOMException('The operation was aborted', 'AbortError')); | ||
| 1466 | + }); | ||
| 1467 | + } | ||
| 1457 | 1468 | return; | |
| 1458 | 1469 | } | |
| 1459 | 1470 | // write(fd, buffer, offset, length, position, callback) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments