Add a wrapper for fopen. On unix-like systems just pass-through. On

windows use unicode version.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-10-13 20:36:28 +02:00
parent ae5540d3d4
commit bb338aaf24
27 changed files with 97 additions and 41 deletions

View file

@ -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);