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

@ -721,7 +721,7 @@ grub_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs)
if (stat (dir, &st) != 0)
return;
FILE *mnttab = fopen ("/etc/mnttab", "r");
FILE *mnttab = grub_util_fopen ("/etc/mnttab", "r");
if (! mnttab)
return;

View file

@ -211,4 +211,10 @@ canonicalize_file_name (const char *path)
#endif
}
FILE *
grub_util_fopen (const char *path, const char *mode)
{
return fopen (path, mode);
}
#endif

View file

@ -36,7 +36,7 @@ grub_get_random (void *out, grub_size_t len)
FILE *f;
size_t rd;
f = fopen ("/dev/urandom", "rb");
f = grub_util_fopen ("/dev/urandom", "rb");
if (!f)
return 1;
rd = fread (out, 1, len, f);