FreeBSD Bugzilla – Attachment 204204 Details for
Bug 237740
dd(1) always report false error about lseek(2) after read(2) error with 'conv=noerror' / dd(1) wrongly lseek(2)ed input file on read(2) error with 'conv=noerror'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fix-dd-noerror-lseek.diff
fix-dd-noerror-lseek.diff (text/plain), 811 bytes, created by
WHR
on 2019-05-04 03:41:23 UTC
(
hide
)
Description:
fix-dd-noerror-lseek.diff
Filename:
MIME Type:
Creator:
WHR
Created:
2019-05-04 03:41:23 UTC
Size:
811 bytes
patch
obsolete
>--- dd.c.orig 2019-05-04 11:13:11.871973993 +0800 >+++ dd.c 2019-05-04 11:12:37.918974408 +0800 >@@ -364,6 +364,7 @@ > dd_in(void) > { > ssize_t n; >+ off_t offset = -1; > > for (;;) { > switch (cpy_cnt) { >@@ -393,6 +394,13 @@ > memset(in.dbp, 0, in.dbsz); > } > >+ if (in.flags & ISSEEK) { >+ offset = lseek(in.fd, 0, SEEK_CUR); >+ if (offset == -1) { >+ warn("%s", in.name); >+ } >+ } >+ > n = read(in.fd, in.dbp, in.dbsz); > if (n == 0) { > in.dbrcnt = 0; >@@ -417,7 +425,8 @@ > * in sector size chunks. > */ > if (in.flags & ISSEEK && >- lseek(in.fd, (off_t)in.dbsz, SEEK_CUR)) >+ (offset == -1 ? lseek(in.fd, (off_t)in.dbsz, SEEK_CUR) : >+ lseek(in.fd, offset + in.dbsz, SEEK_SET)) == -1) > warn("%s", in.name); > > /* If sync not specified, omit block and continue. */
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 237740
: 204204