Commit 869444a
committed
safe_macros: Fix safe_write()
- Add return to the if (rval == -1) branch
If we are in a cleanup the tst_brkm_() will return back and we will
continue and print more tst_brkm_() messages particulary the "short
write()" in the case of SAFE_WRITE_ALL
- Add check for invalid return value (rval < 0)
This will not happen unless there is a bug in libc but we should check
for it anyways.
- Remove TERRNO from the short write tst_brkm_()
Since in a case of a short write the errno is not defined and we will
print whatever was left there.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Link: https://lore.kernel.org/ltp/20250109150336.25235-1-chrubis@suse.cz/1 parent 578ba63 commit 869444a
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
554 | 562 | | |
555 | 563 | | |
556 | 564 | | |
557 | 565 | | |
558 | 566 | | |
559 | 567 | | |
560 | 568 | | |
561 | | - | |
| 569 | + | |
562 | 570 | | |
563 | 571 | | |
564 | 572 | | |
| |||
0 commit comments