[CRIU] [PATCH] pie: open_detach_mount -- Use pr_perror for regular build

Dmitry Safonov dsafonov at virtuozzo.com
Mon Apr 4 02:09:36 PDT 2016


On 04/01/2016 06:08 PM, Cyrill Gorcunov wrote:
> This helper is used in both PIE and non-PIE code.
> For the second we can use normal pr_perror.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>   criu/pie/util.c | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/criu/pie/util.c b/criu/pie/util.c
> index 354667294e37..7dcef39a699b 100644
> --- a/criu/pie/util.c
> +++ b/criu/pie/util.c
> @@ -18,23 +18,29 @@
>   # define __sys(foo)     foo
>   #endif
>   
> +#ifdef CR_NOGLIBC
> +#define __pr_perror(fmt, ...) pr_err(fmt "\n", ##__VA_ARGS__)
> +#else
> +#define __pr_perror(fmt, ...) pr_perror(fmt, ##__VA_ARGS__)
> +#endif
> +
Is it worth to add in criu-log.h define for pr_perror
for CR_NOGLIBC case?
So in files like this everyone will easily use pr_perror?
Something like:
--->8---
@@ -78,7 +78,12 @@ extern void print_on_level(unsigned int loglevel, 
const char *format, ...)
print_on_level(LOG_DEBUG,                                       \
                        LOG_PREFIX fmt, ##__VA_ARGS__)

-#ifndef CR_NOGLIBC
+#ifdef CR_NOGLIBC
+
+#define pr_perror(fmt, ...)                                            \
+       pr_err(fmt "\n", ##__VA_ARGS__)
+
+#else

  #define pr_perror(fmt, ...)                                            \
         pr_err(fmt ": %s\n", ##__VA_ARGS__, strerror(errno))



More information about the CRIU mailing list