mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
* util/misc.c (grub_util_get_image_size): Use FILE functions rather than
stat.
This commit is contained in:
1 parent
e19bec1715
commit
66a1b3eeb7
2 files changed
+17
-5
No files matched your search
@@ -1,3 +1,8 @@
|
|||||||
|
2013-10-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* util/misc.c (grub_util_get_image_size): Use FILE functions rather than
|
||||||
|
stat.
|
||||||
|
|
||||||
2013-10-13 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-10-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* util/grub-editenv.c: Remove leftover set_program_name and init_nls.
|
* util/grub-editenv.c: Remove leftover set_program_name and init_nls.
|
||||||
|
|||||||
+12
-5
@@ -79,14 +79,21 @@ grub_util_get_path (const char *dir, const char *file)
|
|||||||
size_t
|
size_t
|
||||||
grub_util_get_image_size (const char *path)
|
grub_util_get_image_size (const char *path)
|
||||||
{
|
{
|
||||||
struct stat st;
|
FILE *f;
|
||||||
|
size_t ret;
|
||||||
|
|
||||||
grub_util_info ("getting the size of %s", path);
|
f = grub_util_fopen (path, "rb");
|
||||||
|
|
||||||
if (stat (path, &st) == -1)
|
if (!f)
|
||||||
grub_util_error (_("cannot stat `%s': %s"), path, strerror (errno));
|
grub_util_error (_("cannot open `%s': %s"), path, strerror (errno));
|
||||||
|
|
||||||
return st.st_size;
|
fseeko (f, 0, SEEK_END);
|
||||||
|
|
||||||
|
ret = ftello (f);
|
||||||
|
|
||||||
|
fclose (f);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|||||||
Reference in new issue
Block a user