mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 08:10:06 +01:00
core: Fix unextractable translation string
Glib format specifiers are not gettext friendly. It even emits a
warning: src/core/main-utils.c:196: warning: Although being used in a
format string position, the msgid is not a valid C format string."
One possible solution is to use the equivalent format specifiers from
<inttypes.h> like PRId64, available since C99.
Even simpler is to cast the value to a type that is big enough to hold
it according to C specs (i.e. for int64: long long).
Fixes: 50f34217f9 ('main: use _nm_utils_ascii_str_to_int64 instead of strtol for reading pid')
This commit is contained in:
parent
9150a60ae7
commit
c86f9e47fb
1 changed files with 1 additions and 4 deletions
|
|
@ -192,10 +192,7 @@ nm_main_utils_ensure_not_running_pidfile(const char *pidfile)
|
||||||
if (strcmp(process_name, prgname) == 0) {
|
if (strcmp(process_name, prgname) == 0) {
|
||||||
/* Check that the process exists */
|
/* Check that the process exists */
|
||||||
if (kill(pid, 0) == 0) {
|
if (kill(pid, 0) == 0) {
|
||||||
fprintf(stderr,
|
fprintf(stderr, _("%s is already running (pid %lld)\n"), prgname, (long long) pid);
|
||||||
_("%s is already running (pid %" G_GINT64_FORMAT ")\n"),
|
|
||||||
prgname,
|
|
||||||
(gint64) pid);
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue