FreeBSD Bugzilla – Attachment 185973 Details for
Bug 221976
tail(1) can report an incorrect error if stdout becomes a broken pipe
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to avoid calling oerr if there is no errno set.
tail-write-exit.patch (text/plain), 438 bytes, created by
martin
on 2017-09-01 11:26:03 UTC
(
hide
)
Description:
Patch to avoid calling oerr if there is no errno set.
Filename:
MIME Type:
Creator:
martin
Created:
2017-09-01 11:26:03 UTC
Size:
438 bytes
patch
obsolete
>--- usr.bin/tail/extern.h 2016-03-25 01:10:08.000000000 +0000 >+++ usr.bin/tail/extern.h 2017-09-01 11:33:39.451435709 +0100 >@@ -32,8 +32,13 @@ > */ > > #define WR(p, size) do { \ >- if (write(STDOUT_FILENO, p, size) != (ssize_t)size) \ >- oerr(); \ >+ ssize_t res; \ >+ if ((res = write(STDOUT_FILENO, p, size)) != (ssize_t)size) { \ >+ if (res == -1) \ >+ oerr(); \ >+ else \ >+ exit(0); \ >+ } \ > } while(0) > > #define TAILMAPLEN (4<<20)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 221976
: 185973