Create and implemented userManager class
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@@ -1,4 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <syslog.h>
|
||||
@@ -7,10 +10,13 @@
|
||||
#include <signal.h>
|
||||
#include <stdbool.h>
|
||||
#include "pipedata.h"
|
||||
|
||||
#include "locations.h"
|
||||
#include "usermanager.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
openlog("ncsambawatcher", LOG_PID | LOG_CONS, LOG_USER);
|
||||
|
||||
int p1[2];
|
||||
pipe(p1);
|
||||
|
||||
@@ -21,7 +27,13 @@ int main()
|
||||
{
|
||||
close(p1[0]); // read
|
||||
|
||||
|
||||
FILE* logpipe = popen(LOGFILE, "r");
|
||||
std::array<char, 256> buffer;
|
||||
|
||||
while(fgets(buffer.data(), buffer.size(), logpipe) != nullptr)
|
||||
{
|
||||
std::string line(buffer.data());
|
||||
}
|
||||
|
||||
close(p1[1]); // write
|
||||
}
|
||||
@@ -33,6 +45,8 @@ int main()
|
||||
|
||||
close(p1[0]); // read
|
||||
}
|
||||
|
||||
closelog();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user