code refine

pull/37/head
Yu Qing 2017-02-03 11:05:18 +08:00
parent 5857ce92fe
commit 41c6c6d17b
3 changed files with 8 additions and 5 deletions

View File

@ -1648,8 +1648,8 @@ static char *iniProccessFor(char *content, const int content_len,
logWarning("file: "__FILE__", line: %d, "
"invalid step: %d for range: %.*s, set step to 1",
__LINE__, step, rangeLen, pForRange);
step = 1;
count = 0;
*offset = (pEnd + _PREPROCESS_TAG_LEN_ENDFOR) - content;
return content;
}
else
{
@ -1659,7 +1659,8 @@ static char *iniProccessFor(char *content, const int content_len,
logWarning("file: "__FILE__", line: %d, "
"invalid step: %d for range: %.*s", __LINE__,
step, rangeLen, pForRange);
count = 0;
*offset = (pEnd + _PREPROCESS_TAG_LEN_ENDFOR) - content;
return content;
}
}

View File

@ -185,7 +185,8 @@ int get_boot_time(struct timeval *boot_time)
snprintf(left.f_mntonname, sizeof(left.f_mntonname), "%s", mntonname); \
} while (0)
int get_mounted_filesystems(struct fast_statfs *stats, const int size, int *count)
int get_mounted_filesystems(struct fast_statfs *stats,
const int size, int *count)
{
#ifdef OS_LINUX
const char *filename = "/proc/mounts";

View File

@ -141,7 +141,8 @@ int get_boot_time(struct timeval *boot_time);
* count: return the count of the array
* return: error no , 0 success, != 0 fail
*/
int get_mounted_filesystems(struct fast_statfs *stats, const int size, int *count);
int get_mounted_filesystems(struct fast_statfs *stats,
const int size, int *count);
#if defined(OS_LINUX) || defined(OS_FREEBSD)
/** get processes