nm-sudo: fix printf format string in _handle_ping()

src/nm-sudo/nm-sudo.c: In function '_handle_ping':
src/nm-sudo/nm-sudo.c:92:79: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'gint64' {aka 'long long int'} [-Werror=format=]
   92 |     msg = g_strdup_printf("pid=%lu, unique-name=%s, nm-name-owner=%s, since=%ld.%03d%s, pong=%s",
      |                                                                             ~~^
      |                                                                               |
      |                                                                               long int
      |                                                                             %lld
......
   96 |                           running_msec / 1000,
      |                           ~~~~~~~~~~~~~~~~~~~
      |                                        |
      |                                        gint64 {aka long long int}

Fixes: f137b32d31 ('sudo: introduce nm-sudo D-Bus service')
This commit is contained in:
Thomas Haller 2021-07-26 18:08:24 +02:00
parent 0d6adfe8e9
commit ee5030c7bd
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -89,11 +89,12 @@ _handle_ping(GlobalData *gl, GDBusMethodInvocation *invocation, const char *arg)
running_msec = nm_utils_clock_gettime_msec(CLOCK_BOOTTIME) - gl->start_timestamp_msec;
msg = g_strdup_printf("pid=%lu, unique-name=%s, nm-name-owner=%s, since=%ld.%03d%s, pong=%s",
msg = g_strdup_printf("pid=%lu, unique-name=%s, nm-name-owner=%s, since=%" G_GINT64_FORMAT
".%03d%s, pong=%s",
(unsigned long) getpid(),
g_dbus_connection_get_unique_name(gl->dbus_connection),
gl->name_owner ?: "(none)",
running_msec / 1000,
(gint64) (running_msec / 1000),
(int) (running_msec % 1000),
gl->no_auth_for_testing ? ", no-auth-for-testing" : "",
arg);