forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit26e9d4d
committed
Convert elog.c's useful_strerror() into a globally-used strerror wrapper.
elog.c has long had a private strerror wrapper that handles assortedpossible failures or deficiencies of the platform's strerror. On Windows,it also knows how to translate Winsock error codes, which the nativestrerror does not. Move all this code into src/port/strerror.c anddefine strerror() as a macro that invokes it, so that both our frontendand backend code will have all of this behavior.I believe this constitutes an actual bug fix on Windows, since AFAICSour frontend code did not report Winsock error codes properly before this.However, the main point is to lay the groundwork for implementing %min src/port/snprintf.c: the behavior we want %m to have is this one,not the native strerror's.Note that this throws away the prior use of src/port/strerror.c,which was to implement strerror() on platforms lacking it. That'sbeen dead code for nigh twenty years now, since strerror() wasalready required by C89.We should likewise cause strerror_r to use this behavior, butI'll tackle that separately.Patch by me, reviewed by Michael PaquierDiscussion:https://postgr.es/m/2975.1526862605@sss.pgh.pa.us1 parenta49ceda commit26e9d4d
File tree
19 files changed
+299
-311
lines changed- src
- backend
- port/win32
- utils/error
- include
- port
- interfaces
- ecpg
- compatlib
- ecpglib
- pgtypeslib
- libpq
- pl/plpython
- port
- tools/msvc
19 files changed
+299
-311
lines changedLines changed: 0 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15644 | 15644 |
| |
15645 | 15645 |
| |
15646 | 15646 |
| |
15647 |
| - | |
15648 |
| - | |
15649 |
| - | |
15650 |
| - | |
15651 |
| - | |
15652 |
| - | |
15653 |
| - | |
15654 |
| - | |
15655 |
| - | |
15656 |
| - | |
15657 |
| - | |
15658 |
| - | |
15659 |
| - | |
15660 | 15647 |
| |
15661 | 15648 |
| |
15662 | 15649 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1687 | 1687 |
| |
1688 | 1688 |
| |
1689 | 1689 |
| |
1690 |
| - | |
| 1690 | + | |
1691 | 1691 |
| |
1692 | 1692 |
| |
1693 | 1693 |
| |
|
Lines changed: 0 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
690 | 690 |
| |
691 | 691 |
| |
692 | 692 |
| |
693 |
| - | |
694 |
| - | |
695 |
| - | |
696 |
| - | |
697 |
| - | |
698 |
| - | |
699 |
| - | |
700 |
| - | |
701 |
| - | |
702 |
| - | |
703 |
| - | |
704 |
| - | |
705 |
| - | |
706 |
| - | |
707 |
| - | |
708 |
| - | |
709 |
| - | |
710 |
| - | |
711 |
| - | |
712 |
| - | |
713 |
| - | |
714 |
| - | |
715 |
| - | |
716 |
| - | |
717 |
| - | |
718 |
| - | |
719 |
| - | |
720 |
| - | |
721 |
| - | |
722 |
| - | |
723 |
| - | |
724 |
| - | |
725 |
| - | |
726 |
| - | |
727 |
| - | |
728 |
| - |
Lines changed: 1 addition & 216 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
181 |
| - | |
182 |
| - | |
183 | 181 |
| |
184 | 182 |
| |
185 | 183 |
| |
| |||
3360 | 3358 |
| |
3361 | 3359 |
| |
3362 | 3360 |
| |
3363 |
| - | |
| 3361 | + | |
3364 | 3362 |
| |
3365 | 3363 |
| |
3366 | 3364 |
| |
| |||
3383 | 3381 |
| |
3384 | 3382 |
| |
3385 | 3383 |
| |
3386 |
| - | |
3387 |
| - | |
3388 |
| - | |
3389 |
| - | |
3390 |
| - | |
3391 |
| - | |
3392 |
| - | |
3393 |
| - | |
3394 |
| - | |
3395 |
| - | |
3396 |
| - | |
3397 |
| - | |
3398 |
| - | |
3399 |
| - | |
3400 |
| - | |
3401 |
| - | |
3402 |
| - | |
3403 |
| - | |
3404 |
| - | |
3405 |
| - | |
3406 |
| - | |
3407 |
| - | |
3408 |
| - | |
3409 |
| - | |
3410 |
| - | |
3411 |
| - | |
3412 |
| - | |
3413 |
| - | |
3414 |
| - | |
3415 |
| - | |
3416 |
| - | |
3417 |
| - | |
3418 |
| - | |
3419 |
| - | |
3420 |
| - | |
3421 |
| - | |
3422 |
| - | |
3423 |
| - | |
3424 |
| - | |
3425 |
| - | |
3426 |
| - | |
3427 |
| - | |
3428 |
| - | |
3429 |
| - | |
3430 |
| - | |
3431 |
| - | |
3432 |
| - | |
3433 |
| - | |
3434 |
| - | |
3435 |
| - | |
3436 |
| - | |
3437 |
| - | |
3438 |
| - | |
3439 |
| - | |
3440 |
| - | |
3441 |
| - | |
3442 |
| - | |
3443 |
| - | |
3444 |
| - | |
3445 |
| - | |
3446 |
| - | |
3447 |
| - | |
3448 |
| - | |
3449 |
| - | |
3450 |
| - | |
3451 |
| - | |
3452 |
| - | |
3453 |
| - | |
3454 |
| - | |
3455 |
| - | |
3456 |
| - | |
3457 |
| - | |
3458 |
| - | |
3459 |
| - | |
3460 |
| - | |
3461 |
| - | |
3462 |
| - | |
3463 |
| - | |
3464 |
| - | |
3465 |
| - | |
3466 |
| - | |
3467 |
| - | |
3468 |
| - | |
3469 |
| - | |
3470 |
| - | |
3471 |
| - | |
3472 |
| - | |
3473 |
| - | |
3474 |
| - | |
3475 |
| - | |
3476 |
| - | |
3477 |
| - | |
3478 |
| - | |
3479 |
| - | |
3480 |
| - | |
3481 |
| - | |
3482 |
| - | |
3483 |
| - | |
3484 |
| - | |
3485 |
| - | |
3486 |
| - | |
3487 |
| - | |
3488 |
| - | |
3489 |
| - | |
3490 |
| - | |
3491 |
| - | |
3492 |
| - | |
3493 |
| - | |
3494 |
| - | |
3495 |
| - | |
3496 |
| - | |
3497 |
| - | |
3498 |
| - | |
3499 |
| - | |
3500 |
| - | |
3501 |
| - | |
3502 |
| - | |
3503 |
| - | |
3504 |
| - | |
3505 |
| - | |
3506 |
| - | |
3507 |
| - | |
3508 |
| - | |
3509 |
| - | |
3510 |
| - | |
3511 |
| - | |
3512 |
| - | |
3513 |
| - | |
3514 |
| - | |
3515 |
| - | |
3516 |
| - | |
3517 |
| - | |
3518 |
| - | |
3519 |
| - | |
3520 |
| - | |
3521 |
| - | |
3522 |
| - | |
3523 |
| - | |
3524 |
| - | |
3525 |
| - | |
3526 |
| - | |
3527 |
| - | |
3528 |
| - | |
3529 |
| - | |
3530 |
| - | |
3531 |
| - | |
3532 |
| - | |
3533 |
| - | |
3534 |
| - | |
3535 |
| - | |
3536 |
| - | |
3537 |
| - | |
3538 |
| - | |
3539 |
| - | |
3540 |
| - | |
3541 |
| - | |
3542 |
| - | |
3543 |
| - | |
3544 |
| - | |
3545 |
| - | |
3546 |
| - | |
3547 |
| - | |
3548 |
| - | |
3549 |
| - | |
3550 |
| - | |
3551 |
| - | |
3552 |
| - | |
3553 |
| - | |
3554 |
| - | |
3555 |
| - | |
3556 |
| - | |
3557 |
| - | |
3558 |
| - | |
3559 |
| - | |
3560 |
| - | |
3561 |
| - | |
3562 |
| - | |
3563 |
| - | |
3564 |
| - | |
3565 |
| - | |
3566 |
| - | |
3567 |
| - | |
3568 |
| - | |
3569 |
| - | |
3570 |
| - | |
3571 |
| - | |
3572 |
| - | |
3573 |
| - | |
3574 |
| - | |
3575 |
| - | |
3576 |
| - | |
3577 |
| - | |
3578 |
| - | |
3579 |
| - | |
3580 |
| - | |
3581 |
| - | |
3582 |
| - | |
3583 |
| - | |
3584 |
| - | |
3585 |
| - | |
3586 |
| - | |
3587 |
| - | |
3588 |
| - | |
3589 |
| - | |
3590 |
| - | |
3591 |
| - | |
3592 |
| - | |
3593 |
| - | |
3594 |
| - | |
3595 |
| - | |
3596 |
| - | |
3597 |
| - | |
3598 |
| - | |
3599 | 3384 |
| |
3600 | 3385 |
| |
3601 | 3386 |
| |
|
Lines changed: 0 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
534 | 534 |
| |
535 | 535 |
| |
536 | 536 |
| |
537 |
| - | |
538 |
| - | |
539 |
| - | |
540 | 537 |
| |
541 | 538 |
| |
542 | 539 |
| |
|
Lines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
405 | 405 |
| |
406 | 406 |
| |
407 | 407 |
| |
408 |
| - | |
409 |
| - | |
410 |
| - | |
411 |
| - | |
412 |
| - | |
413 | 408 |
| |
414 | 409 |
| |
415 | 410 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
192 | 196 |
| |
193 | 197 |
| |
194 | 198 |
| |
| |||
355 | 359 |
| |
356 | 360 |
| |
357 | 361 |
| |
358 |
| - | |
| 362 | + | |
359 | 363 |
| |
360 | 364 |
| |
361 | 365 |
| |
| |||
403 | 407 |
| |
404 | 408 |
| |
405 | 409 |
| |
406 |
| - | |
| 410 | + | |
407 | 411 |
| |
408 | 412 |
| |
409 | 413 |
| |
|
Lines changed: 2 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
322 | 322 |
| |
323 | 323 |
| |
324 | 324 |
| |
325 |
| - | |
326 |
| - | |
| 325 | + | |
| 326 | + | |
327 | 327 |
| |
328 | 328 |
| |
329 | 329 |
| |
| |||
456 | 456 |
| |
457 | 457 |
| |
458 | 458 |
| |
459 |
| - | |
460 |
| - | |
461 | 459 |
| |
462 | 460 |
| |
463 | 461 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| 5 | + | |
5 | 6 |
|
0 commit comments
Comments
(0)