From 0d05d5eddfb4740cd07758fdb8db84e3c28aef8e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 13 Nov 2017 21:17:36 +0100 Subject: [PATCH] proc_tools: add helper member to put values w/o length; ... align included headers to c++ Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d9ef1aadfb6b16777293c6262c061edad09e921f Author: vanhofen Date: 2017-11-13 (Mon, 13 Nov 2017) Origin message was: ------------------ - proc_tools: add helper member to put values w/o length; ... align included headers to c++ ------------------ This commit was generated by Migit --- src/system/proc_tools.cpp | 10 ++++++++-- src/system/proc_tools.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/system/proc_tools.cpp b/src/system/proc_tools.cpp index 5d863b80b..a4c06296e 100644 --- a/src/system/proc_tools.cpp +++ b/src/system/proc_tools.cpp @@ -10,8 +10,9 @@ #include #include #include -#include /* isspace */ -#include /* sscanf */ +#include /* isspace */ +#include /* sscanf */ +#include #include "proc_tools.h" @@ -28,6 +29,11 @@ int proc_put(const char *path, const char *value, const int len) return ret; } +int proc_put(const char *path, const char *value) +{ + return proc_put(path, value, strlen(value)); +} + int proc_put(const char *path, bool state) { return proc_put(path, state ? "1" : "0", 1); diff --git a/src/system/proc_tools.h b/src/system/proc_tools.h index 720fe1790..187516423 100644 --- a/src/system/proc_tools.h +++ b/src/system/proc_tools.h @@ -9,6 +9,7 @@ #ifndef __PROC_TOOLS_H__ #define __PROC_TOOLS_H__ int proc_put(const char *path, const char *value, const int len); +int proc_put(const char *path, const char *value); 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);