merge mainline into asprintf
This commit is contained in:
commit
2d49abe9e7
342 changed files with 14569 additions and 4699 deletions
|
@ -1,7 +1,7 @@
|
|||
/* grub-fstest.c - debug tool for filesystem driver */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2008,2009,2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -71,7 +71,7 @@ execute_command (char *name, int n, char **args)
|
|||
|
||||
cmd = grub_command_find (name);
|
||||
if (! cmd)
|
||||
grub_util_error ("Can\'t find command %s", name);
|
||||
grub_util_error ("can\'t find command %s", name);
|
||||
|
||||
return (cmd->func) (cmd, n, args);
|
||||
}
|
||||
|
@ -100,9 +100,9 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len))
|
|||
|
||||
dev = grub_device_open (0);
|
||||
if ((! dev) || (! dev->disk))
|
||||
grub_util_error ("Can\'t open device.");
|
||||
grub_util_error ("can\'t open device");
|
||||
|
||||
grub_util_info ("total sectors : %lld.",
|
||||
grub_util_info ("total sectors : %lld",
|
||||
(unsigned long long) dev->disk->total_sectors);
|
||||
|
||||
if (! leng)
|
||||
|
@ -115,7 +115,7 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len))
|
|||
len = (leng > BUF_SIZE) ? BUF_SIZE : leng;
|
||||
|
||||
if (grub_disk_read (dev->disk, 0, skip, len, buf))
|
||||
grub_util_error ("Disk read fails at offset %lld, length %d.",
|
||||
grub_util_error ("disk read fails at offset %lld, length %d",
|
||||
skip, len);
|
||||
|
||||
if (hook (skip, buf, len))
|
||||
|
@ -132,15 +132,15 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len))
|
|||
file = grub_file_open (pathname);
|
||||
if (!file)
|
||||
{
|
||||
grub_util_error ("cannot open file %s.", pathname);
|
||||
grub_util_error ("cannot open file %s", pathname);
|
||||
return;
|
||||
}
|
||||
|
||||
grub_util_info ("file size : %lld.", (unsigned long long) file->size);
|
||||
grub_util_info ("file size : %lld", (unsigned long long) file->size);
|
||||
|
||||
if (skip > file->size)
|
||||
{
|
||||
grub_util_error ("invalid skip value %lld.", (unsigned long long) skip);
|
||||
grub_util_error ("invalid skip value %lld", (unsigned long long) skip);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len))
|
|||
sz = grub_file_read (file, buf, (len > BUF_SIZE) ? BUF_SIZE : len);
|
||||
if (sz < 0)
|
||||
{
|
||||
grub_util_error ("read error at offset %llu.", ofs);
|
||||
grub_util_error ("read error at offset %llu", ofs);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ cmd_cp (char *src, char *dest)
|
|||
|
||||
if ((int) fwrite (buf, 1, len, ff) != len)
|
||||
{
|
||||
grub_util_error ("write error.");
|
||||
grub_util_error ("write error");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ cmd_cp (char *src, char *dest)
|
|||
ff = fopen (dest, "wb");
|
||||
if (ff == NULL)
|
||||
{
|
||||
grub_util_error ("open error.");
|
||||
grub_util_error ("open error");
|
||||
return;
|
||||
}
|
||||
read_file (src, cp_hook);
|
||||
|
@ -212,7 +212,7 @@ cmd_cmp (char *src, char *dest)
|
|||
{
|
||||
if ((int) fread (buf_1, 1, len, ff) != len)
|
||||
{
|
||||
grub_util_error ("read error at offset %llu.", ofs);
|
||||
grub_util_error ("read error at offset %llu", ofs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ cmd_cmp (char *src, char *dest)
|
|||
for (i = 0; i < len; i++, ofs++)
|
||||
if (buf_1[i] != buf[i])
|
||||
{
|
||||
grub_util_error ("compare fail at offset %llu.", ofs);
|
||||
grub_util_error ("compare fail at offset %llu", ofs);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -233,12 +233,12 @@ cmd_cmp (char *src, char *dest)
|
|||
ff = fopen (dest, "rb");
|
||||
if (ff == NULL)
|
||||
{
|
||||
grub_util_error ("open error.");
|
||||
grub_util_error ("open error");
|
||||
return;
|
||||
}
|
||||
|
||||
if ((skip) && (fseeko (ff, skip, SEEK_SET)))
|
||||
grub_util_error ("seek error.");
|
||||
grub_util_error ("seek error");
|
||||
|
||||
read_file (src, cmp_hook);
|
||||
fclose (ff);
|
||||
|
@ -300,7 +300,7 @@ fstest (char **images, int num_disks, int cmd, int n, char **args)
|
|||
argv[2] = host_file;
|
||||
|
||||
if (execute_command ("loopback", 3, argv))
|
||||
grub_util_error ("loopback command fails.");
|
||||
grub_util_error ("loopback command fails");
|
||||
}
|
||||
|
||||
grub_lvm_fini ();
|
||||
|
@ -367,7 +367,7 @@ static void
|
|||
usage (int status)
|
||||
{
|
||||
if (status)
|
||||
fprintf (stderr, "Try ``%s --help'' for more information.\n", program_name);
|
||||
fprintf (stderr, "Try `%s --help' for more information.\n", program_name);
|
||||
else
|
||||
printf ("\
|
||||
Usage: %s [OPTION]... IMAGE_PATH COMMANDS\n\
|
||||
|
@ -402,9 +402,8 @@ main (int argc, char *argv[])
|
|||
int i, cmd, num_opts, image_index, num_disks = 1;
|
||||
|
||||
set_program_name (argv[0]);
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
grub_util_init_nls ();
|
||||
|
||||
/* Find the first non option entry. */
|
||||
for (num_opts = 1; num_opts < argc; num_opts++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue