freezer.c revision 5e97c3fcce787a5bc0f8ceef43aa3e05195b480a
a847d9812b328c048773e705606b10875a929034Eugen Kuksa * lxc: linux Container library
a4344d37747b6733bbd0d8df738b614cb385316cTim Reddehase * (C) Copyright IBM Corp. 2007, 2008
c273fbbb7863507673f695bc85709c0cb715011fTim Reddehase * Daniel Lezcano <dlezcano at fr.ibm.com>
5ec1c6ff5da427d945d7fb708567ce3526c4c741Tim Reddehase * This library is free software; you can redistribute it and/or
98ba1c38b1cce99ecc61117259f2ae05ffe98469Tim Reddehase * modify it under the terms of the GNU Lesser General Public
5ec1c6ff5da427d945d7fb708567ce3526c4c741Tim Reddehase * License as published by the Free Software Foundation; either
81a6387a4ab56a24194ecbabd6609c6bcca568b7Tim Reddehase * version 2.1 of the License, or (at your option) any later version.
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase * This library is distributed in the hope that it will be useful,
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase * but WITHOUT ANY WARRANTY; without even the implied warranty of
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase * Lesser General Public License for more details.
6f84d8dbc4edca35b7e69c8296a257ea17e3b74fTim Reddehase * You should have received a copy of the GNU Lesser General Public
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase * License along with this library; if not, write to the Free Software
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
81a6387a4ab56a24194ecbabd6609c6bcca568b7Tim Reddehasestatic int freeze_unfreeze(const char *name, int freeze)
4949048bda09e116ee3627383e831455954cbe41Tim Reddehase char *freezer, *f = freeze?"FROZEN":"RUNNING";
4949048bda09e116ee3627383e831455954cbe41Tim Reddehase asprintf(&freezer, LXCPATH "/%s/nsgroup/freezer.state", name);
db8aaeeeb3b24f487a5d02c60d18e96e55f6ba85Tim Reddehase lxc_log_syserror("failed to open freezer for '%s'", name);
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehase lxc_log_syserror("failed to write to '%s'", freezer);