A collection of miscellaneous code and comment tweaks.
[ such changes will stop when desk checking ends too ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
buf[size] = '\0';
head = buf;
+
for (;;) {
static ENTRY e; // just to keep coverity off our backs (e.data)
ENTRY *ep;
tail = strchr(head, '\n');
if (!tail)
break;
-
head = tail + 1;
}
mHr(derived_swap_used) = mHr(SwapTotal) - mHr(SwapFree);
// let's not distort the deltas the first time thru ...
- if (!info->meminfo_was_read)
+ if (!info->meminfo_was_read) {
memcpy(&info->hist.old, &info->hist.new, sizeof(struct meminfo_data));
- info->meminfo_was_read = 1;
-
+ info->meminfo_was_read = 1;
+ }
return 0;
#undef mHr
} // end: read_meminfo_failed
* The initial refcount is 1, and needs to be decremented
* to release the resources of the structure.
*
- * Returns: a pointer to a new meminfo struct
+ * Returns: < 0 on failure, 0 on success along with
+ * a pointer to a new context struct
*/
PROCPS_EXPORT int procps_meminfo_new (
struct procps_meminfo **info)
*
* @info: location of returned new structure
*
- * Returns: 0 on success <0 on failure
+ * Returns: < 0 on failure, 0 on success along with
+ * a pointer to a new context struct
*/
PROCPS_EXPORT int procps_pids_new (
struct procps_pidsinfo **info,
else
return -ERANGE;
- if (!info->slabinfo_was_read)
+ if (!info->slabinfo_was_read) {
memcpy(&info->hist.old, &info->hist.new, sizeof(struct slabs_summ));
- info->slabinfo_was_read = 1;
-
+ info->slabinfo_was_read = 1;
+ }
return retval;
} // end: read_slabinfo_failed
*
* @info: location of returned new structure
*
- * Returns: 0 on success <0 on failure
+ * Returns: < 0 on failure, 0 on success along with
+ * a pointer to a new context struct
*/
PROCPS_EXPORT int procps_slabinfo_new (
struct procps_slabinfo **info)
info->sys_hist.new.procs_running = llnum;
// let's not distort the deltas the first time thru ...
- if (!info->stat_was_read)
+ if (!info->stat_was_read) {
memcpy(&info->sys_hist.old, &info->sys_hist.new, sizeof(struct stat_data));
-
- info->stat_was_read = 1;
+ info->stat_was_read = 1;
+ }
return 0;
} // end: read_stat_failed
* The initial refcount is 1, and needs to be decremented
* to release the resources of the structure.
*
- * Returns: a new stat info container
+ * Returns: < 0 on failure, 0 on success along with
+ * a pointer to a new context struct
*/
PROCPS_EXPORT int procps_stat_new (
struct procps_statinfo **info)
buf[size] = '\0';
head = buf;
+
for (;;) {
static ENTRY e; // just to keep coverity off our backs (e.data)
ENTRY *ep;
tail = strchr(head, '\n');
if (!tail)
break;
-
head = tail + 1;
}
// let's not distort the deltas the first time thru ...
- if (!info->vmstat_was_read)
+ if (!info->vmstat_was_read) {
memcpy(&info->hist.old, &info->hist.new, sizeof(struct vmstat_data));
- info->vmstat_was_read = 1;
-
+ info->vmstat_was_read = 1;
+ }
return 0;
} // end: read_vmstat_failed
* The initial refcount is 1, and needs to be decremented
* to release the resources of the structure.
*
- * Returns: a pointer to a new vmstatinfo struct
+ * Returns: < 0 on failure, 0 on success along with
+ * a pointer to a new context struct
*/
PROCPS_EXPORT int procps_vmstat_new (
struct procps_vmstat **info)