Ensure frezer state has changed
Ensure frezer state has changed

A write to the freezer.state file does not gurantee that the state has
changed. To ensure that the freezer state is either FROZEN or THAWED,
read the freezer state and if it has not changed, repeat the write.

Changelog[v2]:
	- Minor reorg of code
	- Comments from Daniel Lezcano:
		- lseek() before each read/write of freezer.state
		- Have lxc_freeze_unfreeze() return -1 on error

Signed-off-by: Sukadev Bhattiprolu <2ac48ee9b8f6042694a5d86ef56b8e10fe5327d1@linux.vnet.ibm.com>
Signed-off-by: Daniel Lezcano <3211518dd4d87cb3f7ee12cb52e14b7fb2bc0446@fr.ibm.com>

smoser/lxc,rldleblanc/lxc,virajs/lxc,lisongmin/lxc,Ponce/lxc,rowhit/lxc,hfuCN/lxc,hkjolhede/lxc,kylef/lxc,ecarrara/lxc,terceiro/lxc,cjwatson/lxc,coconutpilot/lxc-gentoo-new,yubo/lxc,thmo/lxc,major/lxc,federicobriata/lxc,hfuCN/lxc,major/lxc,hallyn/lxc,fwilson42/lxc,akshaykarle/lxc,Distrotech/lxc,ss1h2a3tw/lxc,smoser/lxc,virajs/lxc,akshaykarle/lxc,hallyn/lxc,thmo/lxc,ojkastl/lxc_Patches,fwilson42/lxc,codebauss/lxc,rldleblanc/lxc,federicobriata/lxc,abstrakraft/lxc-android-lxc,weizhenwei/lxc,Pelagicore/lxc,usc-isi/lxc,JohnPeacockMessageSystems/lxc,QingweiPeterLan/cs188-lxc,ioops/lxc,Ponce/lxc,LynxChaus/lxc,szaszg/lxc,federicobriata/lxc,ioops/lxc,jirislaby/lxc,szaszg/lxc,QingweiPeterLan/cs188-lxc,lisongmin/lxc,christiaan/lxc,raspberrypython/lxc,potatosalad/lxc,caglar10ur/lxc,bostjan/lxc,ojkastl/lxc_Patches,abstrakraft/lxc-android-lxc,armcc/lxc,aeris/lxc,Pelagicore/lxc,inokappa/lxc,hfuCN/lxc,ecarrara/lxc,lazy404/lxc,usc-isi/lxc,DarknessBeforeDawn/lxc,bmoar/lxc,terceiro/lxc,akshaykarle/lxc,sapun/lxc,yubo/lxc,glensc/lxc,hkjolhede/lxc,coconutpilot/lxc-gentoo-new,efiop/lxc,ojkastl/lxc_Patches,regit/lxc,LynxChaus/lxc,rowhit/lxc,glensc/lxc,ostap/lxc,inokappa/lxc,GreatFruitOmsk/lxc,regit/lxc,lazy404/lxc,bmoar/lxc,smoser/lxc,sapun/lxc,ecarrara/lxc,caglar10ur/lxc,raspberrypython/lxc,potatosalad/lxc,Ponce/lxc,yubo/lxc,fwilson42/lxc,glensc/lxc,abstrakraft/lxc-android-lxc,regit/lxc,efiop/lxc,lisongmin/lxc,tych0/lxc,thmo/lxc,hallyn/lxc,rldleblanc/lxc,usc-isi/lxc,ojkastl/lxc_Patches,GreatFruitOmsk/lxc,major/lxc,tych0/lxc,LynxChaus/lxc,armcc/lxc,codebauss/lxc,ioops/lxc,tych0/lxc,bmoar/lxc,ysbnim/lxc,GreatFruitOmsk/lxc,caglar10ur/lxc,codebauss/lxc,aeris/lxc,aeris/lxc,lazy404/lxc,Distrotech/lxc,ksperis/lxc,abstrakraft/lxc-android-lxc,jirislaby/lxc,ss1h2a3tw/lxc,weizhenwei/lxc,christiaan/lxc,ostap/lxc,kylef/lxc,hkjolhede/lxc,efiop/lxc,terceiro/lxc,sapun/lxc,raspberrypython/lxc,rowhit/lxc,weizhenwei/lxc,JohnPeacockMessageSystems/lxc,bostjan/lxc,ysbnim/lxc,armcc/lxc,DarknessBeforeDawn/lxc,QingweiPeterLan/cs188-lxc,ksperis/lxc,ss1h2a3tw/lxc,christiaan/lxc,smoser/lxc,bostjan/lxc,cjwatson/lxc,jirislaby/lxc,JohnPeacockMessageSystems/lxc,DarknessBeforeDawn/lxc,ksperis/lxc,szaszg/lxc,Pelagicore/lxc,ysbnim/lxc,Distrotech/lxc,cjwatson/lxc,virajs/lxc