Improve gettext support. Stylistic fixes and error handling fixes while

on it.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-08 19:26:01 +01:00
parent 215c90cb82
commit 9c4b5c13e6
184 changed files with 1175 additions and 959 deletions

View file

@ -22,6 +22,7 @@
#include <grub/time.h>
#include <grub/efi/api.h>
#include <grub/efi/efi.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -39,17 +40,17 @@ send_card_buffer (const struct grub_net_card *dev,
st = efi_call_7 (net->transmit, net, 0, (pack->tail - pack->data),
pack->data, NULL, NULL, NULL);
if (st != GRUB_EFI_SUCCESS)
return grub_error (GRUB_ERR_IO, "couldn't send network packet");
return grub_error (GRUB_ERR_IO, N_("couldn't send network packet"));
while (1)
{
void *txbuf = NULL;
st = efi_call_3 (net->get_status, net, 0, &txbuf);
if (st != GRUB_EFI_SUCCESS)
return grub_error (GRUB_ERR_IO, "couldn't send network packet");
return grub_error (GRUB_ERR_IO, N_("couldn't send network packet"));
if (txbuf)
return GRUB_ERR_NONE;
if (limit_time < grub_get_time_ms ())
return grub_error (GRUB_ERR_TIMEOUT, "couldn't send network packet");
return grub_error (GRUB_ERR_TIMEOUT, N_("couldn't send network packet"));
}
}

View file

@ -27,6 +27,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <grub/term.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -40,7 +41,7 @@ send_card_buffer (const struct grub_net_card *dev __attribute__ ((unused)),
actual = write (fd, pack->data, pack->tail - pack->data);
if (actual < 0)
return grub_error (GRUB_ERR_IO, "couldn't send packets");
return grub_error (GRUB_ERR_IO, N_("couldn't send network packet"));
return GRUB_ERR_NONE;
}

View file

@ -23,6 +23,7 @@
#include <grub/file.h>
#include <grub/misc.h>
#include <grub/env.h>
#include <grub/i18n.h>
#include <grub/machine/pxe.h>
#include <grub/machine/int.h>
@ -269,8 +270,7 @@ grub_pxe_send (const struct grub_net_card *dev __attribute__ ((unused)),
grub_pxe_call (GRUB_PXENV_UNDI_TRANSMIT, trans, pxe_rm_entry);
if (trans->status)
return grub_error (GRUB_ERR_IO, "PXE send failed (status 0x%x)",
trans->status);
return grub_error (GRUB_ERR_IO, N_("couldn't send network packet"));
return 0;
}

View file

@ -21,6 +21,7 @@
#include <grub/dl.h>
#include <grub/net.h>
#include <grub/time.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
@ -69,7 +70,7 @@ send_card_buffer (const struct grub_net_card *dev, struct grub_net_buff *pack)
pack->tail - pack->data, &actual);
if (status)
return grub_error (GRUB_ERR_IO, "Couldn't send network packet.");
return grub_error (GRUB_ERR_IO, N_("couldn't send network packet"));
return GRUB_ERR_NONE;
}