-
Notifications
You must be signed in to change notification settings - Fork 1
/
InterfaceInfoCheckerMain.cpp
48 lines (43 loc) · 1.1 KB
/
InterfaceInfoCheckerMain.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "Processor/InterfaceCheckerProcessor.h"
#include "Common/Common.h"
#include "Common/DBCommon.h"
//------------------------------------
#include <ctime>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <dirent.h>
//------------------------------------
extern "C"
{
#include <pthread.h>
}
#include <iostream>
using namespace std;
#define ListConfig "ConfigList"
int main(int argc, char* argv[])
{
int child_id;
if(CUtilities::CheckExistingProcess("cmdbInterface") != -1)
{
printf ("Process is existed !!\n");
return 0;
}
//===============================FORK==================================//
printf ("Create Interface Process : %s !!\n", argv[0]);
child_id = fork();
if (child_id) {
cout << "I'm parent of " << child_id << endl;
}
else {
CInterfaceCheckerProcessor *pInterfaceCheckerProcessor = new CInterfaceCheckerProcessor("Config.ini");
pInterfaceCheckerProcessor->ProceedCheckDataInfo(INTERFACE_INFO);
delete pInterfaceCheckerProcessor;
}
return 0;
}