mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 09:39:22 +00:00
Add a wrapper for fopen. On unix-like systems just pass-through. On
windows use unicode version.
This commit is contained in:
1 parent
ae5540d3d4
commit
bb338aaf24
27 files changed
+97
-41
No files matched your search
@@ -425,7 +425,7 @@ main (int argc, char **argv)
|
||||
#endif
|
||||
|
||||
#ifndef STANDALONE
|
||||
in = fopen ("tst.bin", "rb");
|
||||
in = grub_util_fopen ("tst.bin", "rb");
|
||||
if (!in)
|
||||
return 1;
|
||||
fseek (in, 0, SEEK_END);
|
||||
@@ -438,11 +438,11 @@ main (int argc, char **argv)
|
||||
|
||||
grub_reed_solomon_add_redundancy (buf, s, rs);
|
||||
|
||||
out = fopen ("tst_rs.bin", "wb");
|
||||
out = grub_util_fopen ("tst_rs.bin", "wb");
|
||||
fwrite (buf, 1, s + rs, out);
|
||||
fclose (out);
|
||||
#else
|
||||
out = fopen ("tst_rs.bin", "rb");
|
||||
out = grub_util_fopen ("tst_rs.bin", "rb");
|
||||
fseek (out, 0, SEEK_END);
|
||||
s = ftell (out);
|
||||
fseek (out, 0, SEEK_SET);
|
||||
@@ -457,12 +457,12 @@ main (int argc, char **argv)
|
||||
grub_memset (buf + 512 * 15, 0, 512);
|
||||
#endif
|
||||
|
||||
out = fopen ("tst_dam.bin", "wb");
|
||||
out = grub_util_fopen ("tst_dam.bin", "wb");
|
||||
fwrite (buf, 1, s + rs, out);
|
||||
fclose (out);
|
||||
grub_reed_solomon_recover (buf, s, rs);
|
||||
|
||||
out = fopen ("tst_rec.bin", "wb");
|
||||
out = grub_util_fopen ("tst_rec.bin", "wb");
|
||||
fwrite (buf, 1, s, out);
|
||||
fclose (out);
|
||||
|
||||
|
||||
Reference in new issue
Block a user