]> git.proxmox.com Git - mirror_lxcfs.git/commit
cgfs: make dorealloc allocate the first batch, too
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 8 Jan 2016 20:16:16 +0000 (12:16 -0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 8 Jan 2016 20:16:16 +0000 (12:16 -0800)
commit1204f57c66a1323e61f019d5dda9684d310bfa2a
treea9c3e1646ad2ba855d9459b3f663593e7c70a909
parent5aaa523a58c7735f4958ece3944596e2183d3cd1
cgfs: make dorealloc allocate the first batch, too

With a short first line the case can be
 *mem = NULL
 oldlen = 0
 newlen = 5 (anything < 50)
making newbatches == oldbatches == 1 causing the
 (newbatches <= oldbatches)
condition to be true.

Let realloc() handle *mem==NULL and use
(!*mem || newbatches > oldbatches) as the only condition.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgfs.c