aboutsummaryrefslogtreecommitdiffstats
path: root/com32/modules
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2010-06-28 02:26:11 -0400
committerShao Miller <shao.miller@yrdsb.edu.on.ca>2010-07-10 01:03:05 -0400
commit3748a9dc3ead604596b7a2c94014ad3817a107cf (patch)
tree24eddf9aae8b06f53619a0c540dd33d337b2ca8b /com32/modules
parent86bf50325b73618cd67a67d5b9a1781877493c07 (diff)
downloadsyslinux-3748a9dc3ead604596b7a2c94014ad3817a107cf.tar.gz
syslinux-3748a9dc3ead604596b7a2c94014ad3817a107cf.tar.xz
syslinux-3748a9dc3ead604596b7a2c94014ad3817a107cf.zip
chain.c32, libcom32: Move write_verify_sector() as disk_write_verify_sector()
Moving portions of chain.c32 into libcom32. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Diffstat (limited to 'com32/modules')
-rw-r--r--com32/modules/chain.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index de827a20..6bf8827e 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -147,22 +147,6 @@ static inline void error(const char *msg)
static struct disk_info diskinfo;
-static int write_verify_sector(unsigned int lba, const void *buf)
-{
- char *rb;
- int rv;
-
- rv = disk_write_sector(&diskinfo, lba, buf);
- if (rv)
- return rv; /* Write failure */
- rb = disk_read_sectors(&diskinfo, lba, 1);
- if (!rb)
- return -1; /* Readback failure */
- rv = memcmp(buf, rb, SECTOR);
- free(rb);
- return rv ? -1 : 0;
-}
-
/*
* CHS (cylinder, head, sector) value extraction macros.
* Taken from WinVBlock. Does not expand to an lvalue
@@ -1008,7 +992,7 @@ static int hide_unhide(struct mbr *mbr, int part)
}
if (write_back)
- return write_verify_sector(0, mbr);
+ return disk_write_verify_sector(&diskinfo, 0, mbr);
return 0; /* ok */
}