1 kumpf 1.2 /*
|
2 martin 1.5 //%LICENSE////////////////////////////////////////////////////////////////
|
3 martin 1.7 //
|
4 martin 1.5 // Licensed to The Open Group (TOG) under one or more contributor license
5 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
6 // this work for additional information regarding copyright ownership.
7 // Each contributor licenses this file to you under the OpenPegasus Open
8 // Source License; you may not use this file except in compliance with the
9 // License.
|
10 martin 1.7 //
|
11 martin 1.5 // Permission is hereby granted, free of charge, to any person obtaining a
12 // copy of this software and associated documentation files (the "Software"),
13 // to deal in the Software without restriction, including without limitation
14 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 // and/or sell copies of the Software, and to permit persons to whom the
16 // Software is furnished to do so, subject to the following conditions:
|
17 martin 1.7 //
|
18 martin 1.5 // The above copyright notice and this permission notice shall be included
19 // in all copies or substantial portions of the Software.
|
20 martin 1.7 //
|
21 martin 1.5 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
22 martin 1.7 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
23 martin 1.5 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
28 martin 1.7 //
|
29 martin 1.5 //////////////////////////////////////////////////////////////////////////
|
30 martin 1.6 */
|
31 martin 1.5
|
32 kumpf 1.2 #include <stdlib.h>
33 #include <signal.h>
|
34 kumpf 1.3 #include <unistd.h>
|
35 kumpf 1.2 #include "Exit.h"
36 #include "Log.h"
37 #include "Globals.h"
38
39 /*
40 **==============================================================================
41 **
42 ** Exit()
43 **
44 ** The executor exit routine, which kills the CIMSERVERMAIN process.
45 **
46 **==============================================================================
47 */
48
49 void Exit(int status)
50 {
51 if (status == 0)
|
52 denise.eckstein 1.4 Log(LL_TRACE, "exited normally", status);
|
53 kumpf 1.2 else
54 Log(LL_WARNING, "exited with status of %d", status);
55
56 /* Kill CIMSERVERMAIN. */
57
58 if (globals.childPid > 0)
59 kill(globals.childPid, SIGTERM);
60
|
61 kumpf 1.3 if (globals.isChildProcess)
62 {
63 _exit(status);
64 }
65 else
66 {
67 exit(status);
68 }
|
69 kumpf 1.2 }
|