diff --git a/src/system/Makefile.am b/src/system/Makefile.am index 4944a7047..9c05d303b 100644 --- a/src/system/Makefile.am +++ b/src/system/Makefile.am @@ -37,7 +37,7 @@ libneutrino_system_a_SOURCES = \ localize.cpp \ helpers.cpp \ ping.cpp \ - proc_tools.c \ + proc_tools.cpp \ settings.cpp \ stacktrace.cpp \ sysload.cpp \ diff --git a/src/system/proc_tools.c b/src/system/proc_tools.cpp similarity index 92% rename from src/system/proc_tools.c rename to src/system/proc_tools.cpp index 0983de937..5d863b80b 100644 --- a/src/system/proc_tools.c +++ b/src/system/proc_tools.cpp @@ -28,6 +28,11 @@ int proc_put(const char *path, const char *value, const int len) return ret; } +int proc_put(const char *path, bool state) +{ + return proc_put(path, state ? "1" : "0", 1); +} + int proc_get(const char *path, char *value, const int len) { int ret, ret2; diff --git a/src/system/proc_tools.h b/src/system/proc_tools.h index 2a3a8cd5e..720fe1790 100644 --- a/src/system/proc_tools.h +++ b/src/system/proc_tools.h @@ -8,13 +8,8 @@ */ #ifndef __PROC_TOOLS_H__ #define __PROC_TOOLS_H__ -#ifdef __cplusplus -extern "C" { -#endif int proc_put(const char *path, const char *value, const int len); +int proc_put(const char *path, bool state); int proc_get(const char *path, char *value, const int len); unsigned int proc_get_hex(const char *path); -#ifdef __cplusplus -} -#endif #endif