[CRIU] Re: [PATCH 3/4] pr_perror(): print error at the end of line

Cyrill Gorcunov gorcunov at openvz.org
Mon Jan 30 12:47:24 EST 2012


On Mon, Jan 30, 2012 at 09:33:48PM +0400, Kirill Kolyshkin wrote:
>
> I thought about it, but it's pretty complicated to insert %m or %s into the
> passed string right before \n. I mean, i can't think of a way to do it.
>

I see. Maybe we can make pr_perror not a wrapper over
pr_err but say own wrapper over printk then we could
inspect the last symbol pushed into boffer and if it's
"\n" just suppress it with strerror, and append back
only when strerror pushed out?

Since the cases where we use pr_perror are mostly error
cases it doesn't matter if this helper will work a little
longer than anything else pr_ helpers since we're in troubles
anyway.

What do you think?

> The other solution is to make all the helpers add \n.
>
> Yet another option is to rename pr_perror into something not
> resembling other helpers.
>
> Yet another option is to explicitly add %m into all pr_perror invocations
> (ie just use pr_err instead). Chances are high it will be forgotten
> from time to time, so not a good idea.
>
	Cyrill


More information about the CRIU mailing list