Skip to contentSkip to conversation

seunshare: always use translations when printing

PATCH In review Rahul Sandhu 2 participants 3 messages Jul 31, 2025 – Oct 7, 2025 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 seunshare: always use translations when printing

Some errors previously were not using gettext for translations, hence wrap them with the _ macro.

---
 sandbox/seunshare.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
sandbox/seunshare.c +7 -7
index 106f625f..97430535 100644
@@ -103,7 +103,7 @@ static int set_signal_handles(void)
 
 	/* Empty the signal mask in case someone is blocking a signal */
 	if (sigemptyset(&empty)) {
-		fprintf(stderr, "Unable to obtain empty signal set\n");
+		fprintf(stderr, _("Unable to obtain empty signal set\n"));
 		return -1;
 	}
 
@@ -111,12 +111,12 @@ static int set_signal_handles(void)
 
 	/* Terminate on SIGHUP */
 	if (signal(SIGHUP, SIG_DFL) == SIG_ERR) {
-		perror("Unable to set SIGHUP handler");
+		perror(_("Unable to set SIGHUP handler"));
 		return -1;
 	}
 
 	if (signal(SIGINT, handler) == SIG_ERR) {
-		perror("Unable to set SIGINT handler");
+		perror(_("Unable to set SIGINT handler"));
 		return -1;
 	}
 
@@ -353,7 +353,7 @@ static int rsynccmd(const char * src, const char *dst, char **cmdbuf)
 
 	/* match glob for all files in src dir */
 	if (asprintf(&buf, "%s/*", src) == -1) {
-		fprintf(stderr, "Out of memory\n");
+		fprintf(stderr, _("Out of memory\n"));
 		return -1;
 	}
 
@@ -371,12 +371,12 @@ static int rsynccmd(const char * src, const char *dst, char **cmdbuf)
 
 		if (!buf) {
 			if (asprintf(&newbuf, "\'%s\'", path) == -1) {
-				fprintf(stderr, "Out of memory\n");
+				fprintf(stderr, _("Out of memory\n"));
 				goto err;
 			}
 		} else {
 			if (asprintf(&newbuf, "%s  \'%s\'", buf, path) == -1) {
-				fprintf(stderr, "Out of memory\n");
+				fprintf(stderr, _("Out of memory\n"));
 				goto err;
 			}
 		}
@@ -387,7 +387,7 @@ static int rsynccmd(const char * src, const char *dst, char **cmdbuf)
 
 	if (buf) {
 		if (asprintf(&newbuf, "/usr/bin/rsync -trlHDq %s '%s'", buf, dst) == -1) {
-			fprintf(stderr, "Out of memory\n");
+			fprintf(stderr, _("Out of memory\n"));
 			goto err;
 		}
 		*cmdbuf=newbuf;
Signature · 1 line
2.50.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Rahul Sandhu

Some errors previously were not using gettext for translations, hence wrap them with the _ macro.

Obviously this will require updating the translation files.

Quoted 69 lines
---
 sandbox/seunshare.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
sandbox/seunshare.c +7 -8
index 106f625f..97430535 100644
@@ -103,7 +103,7 @@ static int set_signal_handles(void)
 
        /* Empty the signal mask in case someone is blocking a signal */
        if (sigemptyset(&empty)) {
-               fprintf(stderr, "Unable to obtain empty signal set\n");
+               fprintf(stderr, _("Unable to obtain empty signal set\n"));
                return -1;
        }
 
@@ -111,12 +111,12 @@ static int set_signal_handles(void)
 
        /* Terminate on SIGHUP */
        if (signal(SIGHUP, SIG_DFL) == SIG_ERR) {
-               perror("Unable to set SIGHUP handler");
+               perror(_("Unable to set SIGHUP handler"));
                return -1;
        }
 
        if (signal(SIGINT, handler) == SIG_ERR) {
-               perror("Unable to set SIGINT handler");
+               perror(_("Unable to set SIGINT handler"));
                return -1;
        }
 
@@ -353,7 +353,7 @@ static int rsynccmd(const char * src, const char *dst, char **cmdbuf)
 
        /* match glob for all files in src dir */
        if (asprintf(&buf, "%s/*", src) == -1) {
-               fprintf(stderr, "Out of memory\n");
+               fprintf(stderr, _("Out of memory\n"));
                return -1;
        }
 
@@ -371,12 +371,12 @@ static int rsynccmd(const char * src, const char *dst, char **cmdbuf)
 
                if (!buf) {
                        if (asprintf(&newbuf, "\'%s\'", path) == -1) {
-                               fprintf(stderr, "Out of memory\n");
+                               fprintf(stderr, _("Out of memory\n"));
                                goto err;
                        }
                } else {
                        if (asprintf(&newbuf, "%s  \'%s\'", buf, path) == -1) {
-                               fprintf(stderr, "Out of memory\n");
+                               fprintf(stderr, _("Out of memory\n"));
                                goto err;
                        }
                }
@@ -387,7 +387,7 @@ static int rsynccmd(const char * src, const char *dst, char **cmdbuf)
 
        if (buf) {
                if (asprintf(&newbuf, "/usr/bin/rsync -trlHDq %s '%s'", buf, dst) == -1) {
-                       fprintf(stderr, "Out of memory\n");
+                       fprintf(stderr, _("Out of memory\n"));
                        goto err;
                }
                *cmdbuf=newbuf;
--

2.50.1