Skip to content
Snippets Groups Projects
Commit ab56736a authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

Merge branch 'issue/16' into 'development'

Update #includes on .cpp and .h



See merge request !15
parents c1915868 ac4a9f30
No related branches found
No related tags found
2 merge requests!51Merge development to master,!15Update #includes on .cpp and .h
Pipeline #
#pragma once
#include <sys/utsname.h>
#include <fstream>
#include <cstring>
int open_file(std::string name, std::ifstream& fstream);
std::string get_distro();
#pragma once
#include <fstream>
#include <string.h>
#include <iostream>
#include <cstring>
std::string get_macaddr();
#pragma once
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <netdb.h>
#include <cstring>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <iostream>
......
#pragma once
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <time.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <utmp.h>
#include <errno.h>
#include <getopt.h>
#include <malloc.h>
#include <netdb.h>
#include <netinet/in.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <time.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <getopt.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <utmp.h>
#include <iostream>
#include <set>
......@@ -70,4 +70,4 @@ struct user_log {
#define R_TIMECHANGE 7 /* NEW_TIME or OLD_TIME */
using namespace std;
int get_user_count ();
int get_user_count();
#pragma once
#include <iostream>
#include "json/json.h"
#include <sys/utsname.h>
#include <time.h>
#include <string.h>
#include <iostream>
#include "agent/linux/get_date.h"
#include "agent/linux/get_machine_type.h"
#include "agent/linux/get_macaddr.h"
#include "agent/linux/get_machine_type.h"
#include "agent/linux/get_time.h"
#include "agent/linux/get_user_count.h"
#include "json/json.h"
int open_file(std::string name, std::ifstream& fstream);
......
......@@ -66,7 +66,6 @@ std::string get_distro() {
// openSuSE
} else if (open_file("/etc/os-release", release_file)) {
const std::string name_key = "NAME=";
const std::string version_key = "VERSION=";
......@@ -105,7 +104,6 @@ std::string get_distro() {
throw std::string("Release file empty or incomplete.");
} else if (open_file("/etc/novell-release", release_file)) {
getline(release_file, line);
if (line.length())
......@@ -114,7 +112,6 @@ std::string get_distro() {
throw std::string("Release file empty.");
} else if (open_file("/etc/sles-release", release_file)) {
getline(release_file, line);
if (line.length())
......@@ -124,7 +121,6 @@ std::string get_distro() {
// fedora
} else if (open_file("/etc/redhat-release", release_file)) {
getline(release_file, line);
if (line.length())
......@@ -136,7 +132,6 @@ std::string get_distro() {
// will find the debian_version file instead of the actual
// distro name
} else if (open_file("/etc/debian-release", release_file)) {
getline(release_file, line);
if (line.length())
......@@ -145,15 +140,12 @@ std::string get_distro() {
throw std::string("Release file empty.");
} else if (open_file("/etc/debian-version", release_file)) {
getline(release_file, line);
if (line.length())
return line;
throw std::string("Release file empty.");
}
throw std::string("No release file found.");
}
......@@ -22,7 +22,6 @@
#include <agent/linux/get_macaddr.h>
std::string get_macaddr() {
std::fstream file;
std::string macaddr;
......@@ -39,5 +38,4 @@ std::string get_macaddr() {
file.close();
return macaddr;
}
......@@ -31,8 +31,7 @@
*/
#include "agent/linux/get_user_count.h"
#include <string>
#include <set>
#include <set>
/* Global variables */
struct utmplist *utmplist = NULL;
......
......@@ -26,7 +26,6 @@ std::string get_processor_model() {
}
Json::Value get_inventory() {
Json::Value inv;
// os info
......@@ -95,5 +94,4 @@ Json::Value get_inventory() {
}
return inv;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment