procfs: Remove newline from the end of the cpuload and loadavg outputs so that the returned percentages can be printed on the same line as other data.

This commit is contained in:
Gregory Nutt 2014-02-27 11:18:28 -06:00
parent cb0d49047a
commit b348464779
3 changed files with 5 additions and 2 deletions

View File

@ -6677,3 +6677,6 @@
time constant related delay elapsed. The total count is now always
guaranteed to add up to 100% (excepting only truncation errors)
(2014-2-27).
* fs/procfs/fs_procfscpuload.c and fs_procfsproc.c: Remove the newline
at the end of the percentage so that the returned strings can be
printed on the same line as other values (2014-2-27).

View File

@ -256,7 +256,7 @@ static ssize_t cpuload_read(FAR struct file *filep, FAR char *buffer,
fracpart = 0;
}
linesize = snprintf(attr->line, CPULOAD_LINELEN, "%3d.%01d%%\n",
linesize = snprintf(attr->line, CPULOAD_LINELEN, "%3d.%01d%%",
intpart, fracpart);
/* Save the linesize in case we are re-entered with f_pos > 0 */

View File

@ -583,7 +583,7 @@ static ssize_t proc_loadavg(FAR struct proc_file_s *procfile,
fracpart = 0;
}
linesize = snprintf(procfile->line, STATUS_LINELEN, "%3d.%01d%%\n",
linesize = snprintf(procfile->line, STATUS_LINELEN, "%3d.%01d%%",
intpart, fracpart);
copysize = procfs_memcpy(procfile->line, linesize, buffer, buflen, &offset);