[CRIU] [PATCH 0/1] simplify the asprintf() failure handling in add_fsname_auto()

Oleg Nesterov oleg at redhat.com
Thu Apr 23 07:30:25 PDT 2015


On 04/23, Oleg Nesterov wrote:
>
> Hmm. I can't check this because I can no longer compile criu after
> git pull,
>
>       make[1]: *** No rule to make target `include/asm-generic/page.h', needed by `arch/x86/crtools.o'.  Stop.
>       make: *** [arch/x86/crtools.built-in.o] Error 2
>^
> Damn. I'll continue after I solve this problem...

I have no idea what was broken. Fixed by "make clean". I'll write
another email about ext-mount-map soon.

But when I looked into git history I noticed another change "check
return code of asprintf".

Thanks a lot Tycho! glibc surprised me again. This was bugfix, not
just "suppress a warning". man asprintf (which I didn't bother to
read) says:

	If memory allocation wasn’t possible, or some other error
	occurs, these functions will return -1 and the contents of
	strp is undefined.


But can't we simplify this a bit? The added "return false" doesn't
look consistent and "fsauto_names = NULL" before asprintf is not
needed. Purely cosmetic, but still...

Oleg.



More information about the CRIU mailing list