kill_SOURCES = skill.c $(top_srcdir)/lib/strutils.c
skill_SOURCES = skill.c $(top_srcdir)/lib/strutils.c
snice_SOURCES = skill.c $(top_srcdir)/lib/strutils.c
+tload_SOURCES = tload.c $(top_srcdir)/lib/strutils.c
pkill_SOURCES = pgrep.c
sysconf_DATA = sysctl.conf
#include "proc/sysinfo.h"
#include "c.h"
#include "nls.h"
+#include "strutils.h"
#include "xalloc.h"
#include <errno.h>
static int ncols = 80;
static int scr_size;
static int fd = 1;
-static int dly = 5;
+static unsigned int dly = 5;
static jmp_buf jb;
static void alrm(int signo __attribute__ ((__unused__)))
double av[3];
static double max_scale, scale_fact;
char *scale_arg = NULL;
+ long tmpdly;
static const struct option longopts[] = {
{"scale", required_argument, NULL, 's'},
scale_arg = optarg;
break;
case 'd':
- dly = atoi(optarg);
+ tmpdly = strtol_or_err(optarg, _("failed to parse argument"));
+ if (tmpdly < 1)
+ errx(EXIT_FAILURE, _("delay must be positive integer"));
+ else if (UINT_MAX < tmpdly)
+ errx(EXIT_FAILURE, _("too large delay value"));
+ dly = tmpdly;
break;
case 'V':
printf(PROCPS_NG_VERSION);