mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 13:48:36 +02: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') (cherry picked from commitc86f9e47fb)
This commit is contained in:
parent
e918871983
commit
c8a34bcf7e
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