PROCPS_EXPORT int procps_diskstat_read (
struct procps_diskstat *info)
{
- int retval, is_disk;
+ int retval;
char buf[DISKSTAT_LINE_LEN];
char devname[DISKSTAT_NAME_LEN];
struct procps_diskstat_dev *disk;
else
nsp->ns[i] = 0;
}
+ return 0;
}
char *restrict const path = PT->path;
for (;;) {
ent = readdir(PT->procfs);
- if(unlikely(unlikely(!ent) || unlikely(!ent->d_name))) return 0;
+ if(unlikely(unlikely(!ent) || unlikely(!ent->d_name[0]))) return 0;
if(likely(likely(*ent->d_name > '0') && likely(*ent->d_name <= '9'))) break;
}
p->tgid = strtoul(ent->d_name, NULL, 10);
}
for (;;) {
ent = readdir(PT->taskdir);
- if(unlikely(unlikely(!ent) || unlikely(!ent->d_name))) return 0;
+ if(unlikely(unlikely(!ent) || unlikely(!ent->d_name[0]))) return 0;
if(likely(likely(*ent->d_name > '0') && likely(*ent->d_name <= '9'))) break;
}
t->tid = strtoul(ent->d_name, NULL, 10);
" proc /proc proc defaults\n" \
" In the meantime, run \"mount proc /proc -t proc\"\n"
-#define STAT_FILE "/proc/stat"
-static int stat_fd = -1;
#define LOADAVG_FILE "/proc/loadavg"
static int loadavg_fd = -1;
-#define MEMINFO_FILE "/proc/meminfo"
-static int meminfo_fd = -1;
-#define VMINFO_FILE "/proc/vmstat"
-static int vminfo_fd = -1;
-#define VM_MIN_FREE_FILE "/proc/sys/vm/min_free_kbytes"
-static int vm_min_free_fd = -1;
// As of 2.6.24 /proc/meminfo seems to need 888 on 64-bit,
// and would need 1258 if the obsolete fields were there.
int updecades, upyears, upweeks, updays, uphours, upminutes;
int pos = 3;
int comma = 0;
- time_t realseconds;
- struct tm *realtime;
double uptime_secs, idle_secs;
shortbuf[0] = '\0';
struct tm *tm_ptr;
char timebuf[32];
const char format[] = "%-5s %6lu %6lu %7lu %7lu %6lu %6lu %7lu %7lu %6lu %6lu";
- const char wide_format[] = "%-5s %9lu %9lu %lu %1u %9lu %9lu %lu %1u %7lu %7lu";
+ const char wide_format[] = "%-5s %9lu %9lu %lu %lu %9lu %9lu %lu %lu %7lu %7lu";
if (procps_diskstat_new(&disk_stat) < 0)
xerr(EXIT_FAILURE,
{
int i, c;
char buf[MAX_ANSIBUF];
- char *numstart, *endptr;
+ char *numstart, *endptr = buf;
c = getc(fp);
if (c != '[') {