McdeSys: common.c's remaining errors in the catalog, German measured (t0282)

The rest of common.c's sentences are messages 74-97 of mcdesys.cat now: the
exec failure line, no host name, no time zone list, no such time zone, the
administrator for the time zone, cannot link, cannot replace (the same text
as message 59, reused), no command line for a process, no room for the CPU
times / memory / network counters / disk counters / process list, that is no
process to signal, the process belongs to somebody else, it is gone, cannot
signal it, no file (and no room) for the comment, no file for the lock, no
name a computer can take, no place for the time service state, cannot set the
clock.  German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls): LANG=C
"\"bad name!\" is not a name a computer can take.", "There is no time zone
\"No/Such\".", "No place for the list of processes."; LANG=de_DE.UTF-8
"\"bad name!\" ist kein Name, den ein Rechner annehmen kann.", "Es gibt keine
Zeitzone \"No/Such\".", "Kein Platz für die Prozessliste."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
This commit is contained in:
lotherk committed 2026-11-16 11:26:21 +00:00
1 parent 893313c873
commit e0ab05b677
4 files changed
+96 -39

No files matched your search

+25 -39
View File
@@ -100,7 +100,7 @@ mcde_sys_run(char *const argv[])
while (waitpid(pid, &st, 0) < 0)
if (errno != EINTR) {
ChildSignal(&saved, 1);
return mcde_sys_fail(MCDE_SYS_EFAIL, "%s: %s.", argv[0],
return mcde_sys_fail(MCDE_SYS_EFAIL, mcde_sys_msg(MSG_EXEC_FAIL, "%s: %s."), argv[0],
strerror(errno));
}
ChildSignal(&saved, 1);
@@ -478,7 +478,7 @@ int
mcde_sys_hostname_get(char *name, size_t len)
{
if (gethostname(name, len) != 0)
return mcde_sys_fail(MCDE_SYS_EFAIL, "No host name: %s.",
return mcde_sys_fail(MCDE_SYS_EFAIL, mcde_sys_msg(MSG_NO_HOSTNAME, "No host name: %s."),
strerror(errno));
name[len - 1] = '\0';
return MCDE_SYS_OK;
@@ -554,8 +554,7 @@ mcde_sys_timezones(char (*zones)[MCDE_SYS_ZONE_LEN], size_t max)
size_t n = 0;
if (fp == NULL && (fp = fopen(ZONEINFO "/zone.tab", "r")) == NULL)
return mcde_sys_fail(MCDE_SYS_ENOENT, "No list of time zones "
"in %s.", ZONEINFO);
return mcde_sys_fail(MCDE_SYS_ENOENT, mcde_sys_msg(MSG_NO_ZONELIST, "No list of time zones in %s."), ZONEINFO);
/* CODES <tab> COORDINATES <tab> TZ [<tab> COMMENTS] */
while (n < max && fgets(line, sizeof line, fp) != NULL) {
char *f, *last = NULL;
@@ -584,27 +583,25 @@ mcde_sys_timezone_set(const char *zone)
if (zone == NULL || zone[0] == '\0' || zone[0] == '/' ||
strstr(zone, "..") != NULL ||
strlen(zone) >= MCDE_SYS_ZONE_LEN)
return mcde_sys_fail(MCDE_SYS_EINVAL, "\"%s\" is no time zone.",
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_BAD_ZONE, "\"%s\" is no time zone."),
zone != NULL ? zone : "");
snprintf(target, sizeof target, ZONEINFO "/%s", zone);
if (stat(target, &st) != 0 || !S_ISREG(st.st_mode))
return mcde_sys_fail(MCDE_SYS_ENOENT, "There is no time zone "
"\"%s\".", zone);
return mcde_sys_fail(MCDE_SYS_ENOENT, mcde_sys_msg(MSG_ZONE_NOT_FOUND, "There is no time zone \"%s\"."), zone);
if (geteuid() != 0)
return mcde_sys_fail(MCDE_SYS_EPERM, "Only the administrator "
"can change the time zone.");
return mcde_sys_fail(MCDE_SYS_EPERM, mcde_sys_msg(MSG_ZONE_EPERM, "Only the administrator can change the time zone."));
/* a new link beside the old one, renamed over it: /etc/localtime is
* never missing (sysinst unlinks first, at install time) */
snprintf(tmp, sizeof tmp, LOCALTIME ".%ld", (long) getpid());
(void) unlink(tmp);
if (symlink(target, tmp) != 0)
return mcde_sys_fail(MCDE_SYS_EFAIL, "Cannot link %s: %s.", tmp,
return mcde_sys_fail(MCDE_SYS_EFAIL, mcde_sys_msg(MSG_CANNOT_LINK, "Cannot link %s: %s."), tmp,
strerror(errno));
if (rename(tmp, LOCALTIME) != 0) {
int e = errno;
(void) unlink(tmp);
return mcde_sys_fail(MCDE_SYS_EFAIL, "Cannot replace %s: %s.",
return mcde_sys_fail(MCDE_SYS_EFAIL, mcde_sys_msg(MSG_SHR_REPLACE, "Cannot replace %s: %s."),
LOCALTIME, strerror(e));
}
/* Debian keeps the name in /etc/timezone as well; only where it is */
@@ -626,8 +623,7 @@ mcde_sys_process_command(pid_t pid, char *buf, size_t len)
int got = mcde_sys_process_args(pid, args, sizeof args);
if (got <= 0 || len < 3)
return mcde_sys_fail(MCDE_SYS_ENOENT, "No command line for "
"process %ld.", (long) pid);
return mcde_sys_fail(MCDE_SYS_ENOENT, mcde_sys_msg(MSG_NO_CMDLINE, "No command line for process %ld."), (long) pid);
for (i = 0; i < (size_t) got && n + 6 < len; ) {
const char *a = args + i;
size_t al = strlen(a), k;
@@ -662,8 +658,7 @@ int
mcde_sys_cpu_times(McdeSysCpu **out, size_t *n)
{
if (out == NULL || n == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No place for the CPU "
"times.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_CPUTIMES, "No place for the CPU times."));
*out = NULL;
*n = 0;
return mcde_sys_cpu_times_backend(out, n);
@@ -673,8 +668,7 @@ int
mcde_sys_memory(McdeSysMemory *m)
{
if (m == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No place for the "
"memory.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_MEMSIZE, "No place for the memory."));
memset(m, 0, sizeof *m);
if (mcde_sys_memory_backend(m) != MCDE_SYS_OK)
return MCDE_SYS_EFAIL;
@@ -693,8 +687,7 @@ int
mcde_sys_net_io(McdeSysNetIo **out, size_t *n)
{
if (out == NULL || n == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No place for the "
"network counters.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_NETCOUNTERS, "No place for the network counters."));
*out = NULL;
*n = 0;
return mcde_sys_net_io_backend(out, n);
@@ -704,8 +697,7 @@ int
mcde_sys_disk_io(McdeSysDiskIo **out, size_t *n)
{
if (out == NULL || n == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No place for the disk "
"counters.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_DISKCOUNTERS, "No place for the disk counters."));
*out = NULL;
*n = 0;
return mcde_sys_disk_io_backend(out, n);
@@ -718,16 +710,14 @@ mcde_sys_signal(long pid, McdeSysSignal sig)
SIGHUP, SIGINT };
if (pid <= 1 || (unsigned) sig >= sizeof numbers / sizeof numbers[0])
return mcde_sys_fail(MCDE_SYS_EINVAL, "That is no process to "
"send a signal to.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_BAD_PROCESS, "That is no process to send a signal to."));
if (kill((pid_t) pid, numbers[sig]) == 0)
return MCDE_SYS_OK;
if (errno == EPERM)
return mcde_sys_fail(MCDE_SYS_EPERM, "The process belongs to "
"somebody else.");
return mcde_sys_fail(MCDE_SYS_EPERM, mcde_sys_msg(MSG_PROCESS_EPERM, "The process belongs to somebody else."));
if (errno == ESRCH)
return mcde_sys_fail(MCDE_SYS_ENOENT, "The process is gone.");
return mcde_sys_fail(MCDE_SYS_EFAIL, "Cannot signal the process: %s.",
return mcde_sys_fail(MCDE_SYS_ENOENT, mcde_sys_msg(MSG_PROCESS_GONE, "The process is gone."));
return mcde_sys_fail(MCDE_SYS_EFAIL, mcde_sys_msg(MSG_SIGNAL_FAIL, "Cannot signal the process: %s."),
strerror(errno));
}
@@ -735,8 +725,7 @@ int
mcde_sys_processes(McdeSysProcess **out, size_t *n)
{
if (out == NULL || n == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No place for the list of "
"processes.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_PROCLIST, "No place for the list of processes."));
*out = NULL;
*n = 0;
return mcde_sys_processes_backend(out, n);
@@ -748,8 +737,7 @@ int
mcde_sys_file_comment_get(const char *path, char *buf, size_t len)
{
if (path == NULL || buf == NULL || len < 2)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No file and no room for the "
"comment.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_COMMENT_ROOM, "No file and no room for the comment."));
buf[0] = '\0';
return mcde_sys_file_comment_get_backend(path, buf, len);
}
@@ -758,7 +746,7 @@ int
mcde_sys_file_comment_set(const char *path, const char *text)
{
if (path == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No file for the comment.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_COMMENT_FILE, "No file for the comment."));
return mcde_sys_file_comment_set_backend(path, text != NULL ? text : "");
}
@@ -766,7 +754,7 @@ int
mcde_sys_file_locked_get(const char *path, int *locked)
{
if (path == NULL || locked == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No file for the lock.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_LOCK_FILE, "No file for the lock."));
*locked = 0;
return mcde_sys_file_locked_get_backend(path, locked);
}
@@ -779,8 +767,7 @@ mcde_sys_hostname_set(const char *name)
if (name == NULL || name[0] == '\0' || name[0] == '-' ||
strspn(name, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789.-") != strlen(name))
return mcde_sys_fail(MCDE_SYS_EINVAL, "\"%s\" is not a name a "
"computer can take.", name != NULL ? name : "");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_BAD_HOSTNAME, "\"%s\" is not a name a computer can take."), name != NULL ? name : "");
return mcde_sys_hostname_set_backend(name);
}
@@ -788,8 +775,7 @@ int
mcde_sys_ntp_get(int *on, char *server, size_t len)
{
if (on == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No place for the state of "
"the time service.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_TIMESTATE, "No place for the state of the time service."));
*on = 0;
if (server != NULL && len > 0)
server[0] = '\0';
@@ -811,7 +797,7 @@ mcde_sys_time_set(time_t when)
tv.tv_sec = when;
tv.tv_usec = 0;
if (settimeofday(&tv, NULL) != 0)
return mcde_sys_fail(MCDE_SYS_EPERM, "Cannot set the clock: %s.",
return mcde_sys_fail(MCDE_SYS_EPERM, mcde_sys_msg(MSG_SETCLOCK_FAIL, "Cannot set the clock: %s."),
strerror(errno));
return MCDE_SYS_OK;
}
@@ -820,6 +806,6 @@ int
mcde_sys_file_locked_set(const char *path, int locked)
{
if (path == NULL)
return mcde_sys_fail(MCDE_SYS_EINVAL, "No file for the lock.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_NO_LOCK_FILE, "No file for the lock."));
return mcde_sys_file_locked_set_backend(path, locked);
}
+23
View File
@@ -77,3 +77,26 @@ $set 1
71 Device events have no source on this system.
72 No room for the event.
73 No room for the mounts.
74 %s: %s.
75 No host name: %s.
76 No list of time zones in %s.
77 "%s" is no time zone.
78 There is no time zone "%s".
79 Only the administrator can change the time zone.
80 Cannot link %s: %s.
82 No command line for process %ld.
83 No place for the CPU times.
84 No place for the memory.
85 No place for the network counters.
86 No place for the disk counters.
87 That is no process to send a signal to.
88 The process belongs to somebody else.
89 The process is gone.
90 Cannot signal the process: %s.
91 No place for the list of processes.
92 No file and no room for the comment.
93 No file for the comment.
94 No file for the lock.
95 "%s" is not a name a computer can take.
96 No place for the state of the time service.
97 Cannot set the clock: %s.
+25
View File
@@ -96,6 +96,31 @@ int mcde_sys_fail(int status, const char *fmt, ...);
#define MSG_EVT_NO_SOURCE 71
#define MSG_EVT_NO_ROOM 72
#define MSG_MNT_NO_ROOM 73
/* common.c, the rest: host name, time zone, the processes and the clock */
#define MSG_EXEC_FAIL 74
#define MSG_NO_HOSTNAME 75
#define MSG_NO_ZONELIST 76
#define MSG_BAD_ZONE 77
#define MSG_ZONE_NOT_FOUND 78
#define MSG_ZONE_EPERM 79
#define MSG_CANNOT_LINK 80
/* 81 was "Cannot replace %s: %s.", which is MSG_SHR_REPLACE (59) */
#define MSG_NO_CMDLINE 82
#define MSG_NO_CPUTIMES 83
#define MSG_NO_MEMSIZE 84
#define MSG_NO_NETCOUNTERS 85
#define MSG_NO_DISKCOUNTERS 86
#define MSG_BAD_PROCESS 87
#define MSG_PROCESS_EPERM 88
#define MSG_PROCESS_GONE 89
#define MSG_SIGNAL_FAIL 90
#define MSG_NO_PROCLIST 91
#define MSG_NO_COMMENT_ROOM 92
#define MSG_NO_COMMENT_FILE 93
#define MSG_NO_LOCK_FILE 94
#define MSG_BAD_HOSTNAME 95
#define MSG_NO_TIMESTATE 96
#define MSG_SETCLOCK_FAIL 97
const char *mcde_sys_msg(int n, const char *text);
/* run ARGV (an absolute path first) and wait; MCDE_SYS_OK on exit status 0 */
@@ -75,3 +75,26 @@ $set 1
71 Geräteereignisse haben auf diesem System keine Quelle.
72 Kein Platz für das Ereignis.
73 Kein Platz für die Einhängepunkte.
74 %s: %s.
75 Kein Rechnername: %s.
76 Keine Liste der Zeitzonen in %s.
77 "%s" ist keine Zeitzone.
78 Es gibt keine Zeitzone "%s".
79 Nur der Administrator kann die Zeitzone ändern.
80 %s kann nicht verknüpft werden: %s.
82 Keine Kommandozeile für Prozess %ld.
83 Kein Platz für die CPU-Zeiten.
84 Kein Platz für den Speicher.
85 Kein Platz für die Netzwerkzähler.
86 Kein Platz für die Plattenzähler.
87 Das ist kein Prozess, dem ein Signal gesendet werden kann.
88 Der Prozess gehört jemand anderem.
89 Der Prozess ist weg.
90 Dem Prozess kann kein Signal gesendet werden: %s.
91 Kein Platz für die Prozessliste.
92 Keine Datei und kein Platz für den Kommentar.
93 Keine Datei für den Kommentar.
94 Keine Datei für die Sperre.
95 "%s" ist kein Name, den ein Rechner annehmen kann.
96 Kein Platz für den Zustand des Zeitdienstes.
97 Die Uhr kann nicht gestellt werden: %s.