Commit c0e7fc8
committed
fix(qwp): save win32 errno at the failure point in the open_file siblings
Completes the errno-capture pattern 958a36d established for open_file/
fsyncDir0: seven sites across five natives -- length0 (CreateFileW and
GetFileSizeEx failures), mkdir0, remove0, rename0, and findFirst0 (both
the utf8_to_wide and FindFirstFileW failures) -- called SaveLastError()
only AFTER free()/CloseHandle(), either of which may overwrite the
thread's last-error value (HeapFree can SetLastError). The saved errno
for a failed operation could therefore be an unrelated code or 0.
Inert to behavior: repo-wide, nothing branches on the saved value for
these operations -- fsyncDir0 was the sole control-flow consumer and
already reads its own capture via GetSavedLastError() -- so the exposure
was wrong [errno=N] diagnostics in Windows failure messages. Save now
happens at the failure point; cleanup follows on every path unchanged.
Windows-only TU: verified by mechanical review (order-only transform,
brace/paren balance identical, statement-level clobber audit clean);
compile coverage via the native build pipeline.1 parent ab2b3b6 commit c0e7fc8
1 file changed
Lines changed: 25 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
365 | 367 | | |
| 368 | + | |
366 | 369 | | |
367 | 370 | | |
| 371 | + | |
368 | 372 | | |
369 | 373 | | |
370 | | - | |
371 | 374 | | |
| 375 | + | |
372 | 376 | | |
| 377 | + | |
373 | 378 | | |
374 | 379 | | |
| 380 | + | |
375 | 381 | | |
376 | 382 | | |
377 | 383 | | |
| |||
414 | 420 | | |
415 | 421 | | |
416 | 422 | | |
417 | | - | |
418 | 423 | | |
| 424 | + | |
419 | 425 | | |
| 426 | + | |
420 | 427 | | |
421 | 428 | | |
| 429 | + | |
422 | 430 | | |
423 | 431 | | |
424 | 432 | | |
| |||
447 | 455 | | |
448 | 456 | | |
449 | 457 | | |
450 | | - | |
451 | 458 | | |
| 459 | + | |
452 | 460 | | |
| 461 | + | |
453 | 462 | | |
454 | 463 | | |
| 464 | + | |
455 | 465 | | |
456 | 466 | | |
457 | 467 | | |
| |||
469 | 479 | | |
470 | 480 | | |
471 | 481 | | |
472 | | - | |
473 | | - | |
474 | 482 | | |
| 483 | + | |
475 | 484 | | |
| 485 | + | |
| 486 | + | |
476 | 487 | | |
477 | 488 | | |
| 489 | + | |
| 490 | + | |
478 | 491 | | |
479 | 492 | | |
480 | 493 | | |
| |||
512 | 525 | | |
513 | 526 | | |
514 | 527 | | |
515 | | - | |
516 | 528 | | |
| 529 | + | |
517 | 530 | | |
| 531 | + | |
518 | 532 | | |
519 | 533 | | |
| 534 | + | |
520 | 535 | | |
521 | 536 | | |
522 | 537 | | |
523 | 538 | | |
524 | 539 | | |
525 | 540 | | |
526 | 541 | | |
527 | | - | |
528 | 542 | | |
| 543 | + | |
529 | 544 | | |
| 545 | + | |
530 | 546 | | |
531 | 547 | | |
532 | 548 | | |
| 549 | + | |
533 | 550 | | |
534 | 551 | | |
535 | 552 | | |
| |||
0 commit comments