summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@redhat.com>2023-04-26 18:02:40 +0000
committerMichael Catanzaro <mcatanzaro@redhat.com>2023-04-26 18:02:40 +0000
commit1db9976099018b357cac3452cf27e37852116592 (patch)
treed413b672cd143d08a360144cbd9d782a9fe951b6
parent41ae5b5632ce9f6b2b5613ec1912821f769166c2 (diff)
parentaae4df5c6bb93aef674bcba5bff74ebb5807c61a (diff)
downloadglib-1db9976099018b357cac3452cf27e37852116592.tar.gz
Merge branch 'backport-3400-error-literals-dngettext-glib-2-76' into 'glib-2-76'
Backport !3400 “Revert "Fix error format in gio/gunixconnection.c (part 2)"” to glib-2-76 See merge request GNOME/glib!3403
-rw-r--r--gio/gunixconnection.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/gio/gunixconnection.c b/gio/gunixconnection.c
index c012fcbfe..7b466cdf9 100644
--- a/gio/gunixconnection.c
+++ b/gio/gunixconnection.c
@@ -176,10 +176,12 @@ g_unix_connection_receive_fd (GUnixConnection *connection,
{
gint i;
- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- ngettext ("Expecting 1 control message, got %d",
- "Expecting 1 control message, got %d",
- nscm));
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ g_dngettext (NULL,
+ "Expecting 1 control message, got %d",
+ "Expecting 1 control message, got %d",
+ nscm),
+ nscm);
for (i = 0; i < nscm; i++)
g_object_unref (scms[i]);
@@ -209,10 +211,12 @@ g_unix_connection_receive_fd (GUnixConnection *connection,
{
gint i;
- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- ngettext ("Expecting one fd, but got %d\n",
- "Expecting one fd, but got %d\n",
- nfd));
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ g_dngettext (NULL,
+ "Expecting one fd, but got %d\n",
+ "Expecting one fd, but got %d\n",
+ nfd),
+ nfd);
for (i = 0; i < nfd; i++)
close (fds[i]);
@@ -590,12 +594,14 @@ g_unix_connection_receive_credentials (GUnixConnection *connection,
{
if (nscm != 1)
{
- g_set_error_literal (error,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- ngettext ("Expecting 1 control message, got %d",
- "Expecting 1 control message, got %d",
- nscm));
+ g_set_error (error,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ g_dngettext (NULL,
+ "Expecting 1 control message, got %d",
+ "Expecting 1 control message, got %d",
+ nscm),
+ nscm);
goto out;
}