FreeBSD Bugzilla – Attachment 138933 Details for
Bug 185070
[patch] dd(1) add better error message when partial write to dev
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 850 bytes, created by
luke.tw
on 2013-12-21 14:40:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
luke.tw
Created:
2013-12-21 14:40:00 UTC
Size:
850 bytes
patch
obsolete
>--- dd.c.old 2013-12-21 21:07:38.000000000 +0800 >+++ dd.c 2013-12-21 21:57:32.000000000 +0800 >@@ -49,6 +49,7 @@ > #include <sys/stat.h> > #include <sys/conf.h> > #include <sys/disklabel.h> >+#include <sys/disk.h> > #include <sys/filio.h> > #include <sys/time.h> > >@@ -469,6 +470,17 @@ > if (nw <= 0) { > if (nw == 0) > errx(1, "%s: end of device", out.name); >+ if (errno == EINVAL){ >+ size_t sectorsz = 0; >+ if (ioctl(out.fd, DIOCGSECTORSIZE , §orsz) == 0) { >+ if ( out.dbsz % sectorsz) >+ errx(1, "bs=%zu: not a multiple of %s's sector size (%zu bytes)", >+ out.dbsz, out.name, sectorsz); >+ else if (cnt < sectorsz) >+ errx(1, "%s: not a multiple of %s's sector size (%zu bytes)", >+ in.name, out.name, sectorsz); >+ } >+ } > if (errno != EINTR) > err(1, "%s", out.name); > nw = 0;
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 185070
: 138933