[CRIU] [PATCH 6/6] pie: add %z support to pie's printf
Tycho Andersen
tycho.andersen at canonical.com
Tue Feb 23 08:20:01 PST 2016
On Mon, Feb 22, 2016 at 06:44:16PM -0800, Kir Kolyshkin wrote:
> This is handy whenever we want to print size_t or ssize_t.
>
> Signed-off-by: Kir Kolyshkin <kir at openvz.org>
Acked-by: Tycho Andersen <tycho.andersen at canonical.com>
Thanks, much better :)
> ---
> criu/pie/log-simple.c | 3 +++
> criu/pie/parasite.c | 2 +-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/criu/pie/log-simple.c b/criu/pie/log-simple.c
> index 1cc877d..c33cc1b 100644
> --- a/criu/pie/log-simple.c
> +++ b/criu/pie/log-simple.c
> @@ -225,6 +225,9 @@ void sbuf_printf(struct simple_buf *b, const char *format, va_list args)
> s++;
> if (*s == 'l')
> s++;
> + } else if (*s == 'z') {
> + along = (sizeof(size_t) > sizeof(int));
> + s++;
> }
>
> switch (*s) {
> diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
> index 2466665..5c6898f 100644
> --- a/criu/pie/parasite.c
> +++ b/criu/pie/parasite.c
> @@ -521,7 +521,7 @@ static int __parasite_daemon_reply_ack(unsigned int cmd, int err)
> m = ctl_msg_ack(cmd, err);
> ret = sys_sendto(tsock, &m, sizeof(m), 0, NULL, 0);
> if (ret != sizeof(m)) {
> - pr_err("Sent only %d bytes while %lu expected\n", ret, sizeof(m));
> + pr_err("Sent only %d bytes while %zu expected\n", ret, sizeof(m));
> return -1;
> }
>
> --
> 2.5.0
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list