FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
utils.c
Go to the documentation of this file.
1 /***************************************************************
2  Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
3  Copyright (C) 2019 Siemens AG
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 
18  ***************************************************************/
24 #include "maintagent.h"
25 
33 FUNCTION void exitNow(int exitVal)
34 {
35  if (pgConn) PQfinish(pgConn);
37 
38  if (exitVal) LOG_ERROR("Exiting with status %d", exitVal);
39 
40  fo_scheduler_disconnect(exitVal);
41  exit(exitVal);
42 } /* ExitNow() */
PGconn * pgConn
Database connection.
Definition: adj2nest.c:98
void fo_scheduler_disconnect(int retcode)
Disconnect the scheduler connection.
FUNCTION void exitNow(int exitVal)
Exit function. This does all cleanup and should be used instead of calling exit() or main() return...
Definition: utils.c:33
fo_dbManager * dbManager
fo_dbManager object
Definition: process.c:28
void fo_dbManager_free(fo_dbManager *dbManager)
Un-allocate the memory from a DB manager.
Definition: standalone.c:29