diff --git a/src/sigar_util.c b/src/sigar_util.c index 23f8f820..678c4299 100644 --- a/src/sigar_util.c +++ b/src/sigar_util.c @@ -98,22 +98,6 @@ char *sigar_getword(char **line, char stop) return res; } -int sigar_file2str(const char *fname, char *buffer, int buflen) -{ - int len; - int fd = open(fname, O_RDONLY); - - if (fd < 0) { - return ENOENT; - } - - len = read(fd, buffer, buflen); - buffer[len] = '\0'; - close(fd); - - return SIGAR_OK; -} - /* avoiding sprintf */ char *sigar_proc_filename(char *buffer, int buflen, @@ -588,6 +572,22 @@ SIGAR_DECLARE(int) sigar_rpc_ping(char *host, } #endif +int sigar_file2str(const char *fname, char *buffer, int buflen) +{ + int len; + int fd = open(fname, O_RDONLY); + + if (fd < 0) { + return ENOENT; + } + + len = read(fd, buffer, buflen); + buffer[len] = '\0'; + close(fd); + + return SIGAR_OK; +} + #ifdef WIN32 #define vsnprintf _vsnprintf #endif