| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 52b3b54 commit f2279f8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -334,6 +334,11 @@ function readFile(path, options, callback) { | |||
| 334 | 334 | return; | |
| 335 | 335 | } | |
| 336 | 336 | ||
| 337 | + if (options.signal?.aborted) { | ||
| 338 | + callback(lazyDOMException('The operation was aborted', 'AbortError')); | ||
| 339 | + return; | ||
| 340 | + } | ||
| 341 | + | ||
| 337 | 342 | const flagsNumber = stringToFlags(options.flag); | |
| 338 | 343 | path = getValidatedPath(path); | |
| 339 | 344 | ||
@@ -1440,7 +1445,13 @@ function lutimesSync(path, atime, mtime) { | |||
| 1440 | 1445 | ||
| 1441 | 1446 | function writeAll(fd, isUserFd, buffer, offset, length, signal, callback) { | |
| 1442 | 1447 | if (signal?.aborted) { | |
| 1443 | - callback(lazyDOMException('The operation was aborted', 'AbortError')); | ||
| 1448 | + if (isUserFd) { | ||
| 1449 | + callback(lazyDOMException('The operation was aborted', 'AbortError')); | ||
| 1450 | + } else { | ||
| 1451 | + fs.close(fd, function() { | ||
| 1452 | + callback(lazyDOMException('The operation was aborted', 'AbortError')); | ||
| 1453 | + }); | ||
| 1454 | + } | ||
| 1444 | 1455 | return; | |
| 1445 | 1456 | } | |
| 1446 | 1457 | // write(fd, buffer, offset, length, position, callback) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments