FreeBSD Bugzilla – Attachment 8413 Details for
Bug 17640
lseek();read() -> pread() in dump and fsck
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.29 KB, created by
Dan Nelson (old address)
on 2000-03-28 17:10:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Dan Nelson (old address)
Created:
2000-03-28 17:10:00 UTC
Size:
1.29 KB
patch
obsolete
>Index: sbin/dump/traverse.c >=================================================================== >RCS file: /home/ncvs/src/sbin/dump/traverse.c,v >retrieving revision 1.10 >diff -b -u -r1.10 traverse.c >--- sbin/dump/traverse.c 1999/08/28 00:12:39 1.10 >+++ sbin/dump/traverse.c 2000/03/24 05:33:51 >@@ -556,10 +556,7 @@ > extern int errno; > > loop: >- if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) != >- ((off_t)blkno << dev_bshift)) >- msg("bread: lseek fails\n"); >- if ((cnt = read(diskfd, buf, size)) == size) >+ if ((cnt = pread(diskfd, buf, size, (off_t)blkno << dev_bshift)) == size) > return; > if (blkno + (size / dev_bsize) > fsbtodb(sblock, sblock->fs_size)) { > /* >Index: sbin/fsck/utilities.c >=================================================================== >RCS file: /home/ncvs/src/sbin/fsck/utilities.c,v >retrieving revision 1.11 >diff -b -u -r1.11 utilities.c >--- sbin/fsck/utilities.c 1999/08/28 00:12:49 1.11 >+++ sbin/fsck/utilities.c 1999/11/25 05:54:06 >@@ -327,11 +327,9 @@ > > offset = blk; > offset *= dev_bsize; >- if (lseek(fd, offset, 0) < 0) >- rwerror("SEEK", blk); >- else if (read(fd, buf, (int)size) == size) >+ if (pread(fd, buf, (int)size, offset) == size) > return (0); >- rwerror("READ", blk); >+ rwerror("PREAD", blk); > if (lseek(fd, offset, 0) < 0) > rwerror("SEEK", blk); > errs = 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 17640
: 8413