summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--login-utils/last.c6
-rw-r--r--login-utils/lslogins.c6
-rw-r--r--misc-utils/logger.c14
-rw-r--r--sys-utils/dmesg.c14
-rw-r--r--sys-utils/ipcrm.c8
-rw-r--r--sys-utils/lsipc.c6
-rw-r--r--sys-utils/rtcwake.c6
7 files changed, 30 insertions, 30 deletions
diff --git a/login-utils/last.c b/login-utils/last.c
index 0c234f5e4..6d0e8920a 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -163,15 +163,15 @@ static time_t lastdate; /* Last date we've seen */
static time_t currentdate; /* date when we started processing the file */
/* --time-format=option parser */
-static int which_time_format(const char *optarg)
+static int which_time_format(const char *s)
{
size_t i;
for (i = 0; i < ARRAY_SIZE(timefmts); i++) {
- if (strcmp(timefmts[i].name, optarg) == 0)
+ if (strcmp(timefmts[i].name, s) == 0)
return i;
}
- errx(EXIT_FAILURE, _("unknown time format: %s"), optarg);
+ errx(EXIT_FAILURE, _("unknown time format: %s"), s);
}
/*
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 60a1b500f..76ada7fd2 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -1200,7 +1200,7 @@ static void free_user(void *f)
free(u);
}
-static int parse_time_mode(const char *optarg)
+static int parse_time_mode(const char *s)
{
struct lslogins_timefmt {
const char *name;
@@ -1214,10 +1214,10 @@ static int parse_time_mode(const char *optarg)
size_t i;
for (i = 0; i < ARRAY_SIZE(timefmts); i++) {
- if (strcmp(timefmts[i].name, optarg) == 0)
+ if (strcmp(timefmts[i].name, s) == 0)
return timefmts[i].val;
}
- errx(EXIT_FAILURE, _("unknown time format: %s"), optarg);
+ errx(EXIT_FAILURE, _("unknown time format: %s"), s);
}
static void __attribute__((__noreturn__)) usage(FILE *out)
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index dbb9cdc24..4fb650a42 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -804,11 +804,11 @@ static void syslog_rfc5424_header(struct logger_ctl *const ctl)
free(structured);
}
-static void parse_rfc5424_flags(struct logger_ctl *ctl, char *optarg)
+static void parse_rfc5424_flags(struct logger_ctl *ctl, char *s)
{
char *in, *tok;
- in = optarg;
+ in = s;
while ((tok = strtok(in, ","))) {
in = NULL;
if (!strcmp(tok, "notime")) {
@@ -823,15 +823,15 @@ static void parse_rfc5424_flags(struct logger_ctl *ctl, char *optarg)
}
}
-static int parse_unix_socket_errors_flags(char *optarg)
+static int parse_unix_socket_errors_flags(char *s)
{
- if (!strcmp(optarg, "off"))
+ if (!strcmp(s, "off"))
return AF_UNIX_ERRORS_OFF;
- if (!strcmp(optarg, "on"))
+ if (!strcmp(s, "on"))
return AF_UNIX_ERRORS_ON;
- if (!strcmp(optarg, "auto"))
+ if (!strcmp(s, "auto"))
return AF_UNIX_ERRORS_AUTO;
- warnx(_("invalid argument: %s: using automatic errors"), optarg);
+ warnx(_("invalid argument: %s: using automatic errors"), s);
return AF_UNIX_ERRORS_AUTO;
}
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 92de6e26f..a2ab3a2e3 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -1178,19 +1178,19 @@ static int read_kmsg(struct dmesg_control *ctl)
return 0;
}
-static int which_time_format(const char *optarg)
+static int which_time_format(const char *s)
{
- if (!strcmp(optarg, "notime"))
+ if (!strcmp(s, "notime"))
return DMESG_TIMEFTM_NONE;
- if (!strcmp(optarg, "ctime"))
+ if (!strcmp(s, "ctime"))
return DMESG_TIMEFTM_CTIME;
- if (!strcmp(optarg, "delta"))
+ if (!strcmp(s, "delta"))
return DMESG_TIMEFTM_DELTA;
- if (!strcmp(optarg, "reltime"))
+ if (!strcmp(s, "reltime"))
return DMESG_TIMEFTM_RELTIME;
- if (!strcmp(optarg, "iso"))
+ if (!strcmp(s, "iso"))
return DMESG_TIMEFTM_ISO8601;
- errx(EXIT_FAILURE, _("unknown time format: %s"), optarg);
+ errx(EXIT_FAILURE, _("unknown time format: %s"), s);
}
#ifdef TEST_DMESG
diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c
index 7912feed9..06bbd446b 100644
--- a/sys-utils/ipcrm.c
+++ b/sys-utils/ipcrm.c
@@ -191,13 +191,13 @@ static unsigned long strtokey(const char *str, const char *errmesg)
return 0;
}
-static int key_to_id(type_id type, char *optarg)
+static int key_to_id(type_id type, char *s)
{
int id;
/* keys are in hex or decimal */
- key_t key = strtokey(optarg, "failed to parse argument");
+ key_t key = strtokey(s, "failed to parse argument");
if (key == IPC_PRIVATE) {
- warnx(_("illegal key (%s)"), optarg);
+ warnx(_("illegal key (%s)"), s);
return -1;
}
switch (type) {
@@ -230,7 +230,7 @@ static int key_to_id(type_id type, char *optarg)
default:
err(EXIT_FAILURE, _("key failed"));
}
- warnx("%s (%s)", errmsg, optarg);
+ warnx("%s (%s)", errmsg, s);
}
return id;
}
diff --git a/sys-utils/lsipc.c b/sys-utils/lsipc.c
index 9041dc17b..d4e5037ad 100644
--- a/sys-utils/lsipc.c
+++ b/sys-utils/lsipc.c
@@ -249,7 +249,7 @@ static char *get_groupname(struct group **gr, gid_t id)
return *gr ? xstrdup((*gr)->gr_name) : NULL;
}
-static int parse_time_mode(const char *optarg)
+static int parse_time_mode(const char *s)
{
struct lsipc_timefmt {
const char *name;
@@ -263,10 +263,10 @@ static int parse_time_mode(const char *optarg)
size_t i;
for (i = 0; i < ARRAY_SIZE(timefmts); i++) {
- if (strcmp(timefmts[i].name, optarg) == 0)
+ if (strcmp(timefmts[i].name, s) == 0)
return timefmts[i].val;
}
- errx(EXIT_FAILURE, _("unknown time format: %s"), optarg);
+ errx(EXIT_FAILURE, _("unknown time format: %s"), s);
}
static void __attribute__ ((__noreturn__)) usage(FILE * out)
diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
index 053baf5ef..536c5bf5c 100644
--- a/sys-utils/rtcwake.c
+++ b/sys-utils/rtcwake.c
@@ -344,18 +344,18 @@ static int print_alarm(struct rtcwake_control *ctl, int fd)
return 0;
}
-static int get_rtc_mode(struct rtcwake_control *ctl, const char *optarg)
+static int get_rtc_mode(struct rtcwake_control *ctl, const char *s)
{
size_t i;
char **modes = get_sys_power_states(ctl), **m;
STRV_FOREACH(m, modes) {
- if (strcmp(optarg, *m) == 0)
+ if (strcmp(s, *m) == 0)
return SYSFS_MODE;
}
for (i = 0; i < ARRAY_SIZE(rtcwake_mode_string); i++)
- if (!strcmp(optarg, rtcwake_mode_string[i]))
+ if (!strcmp(s, rtcwake_mode_string[i]))
return i;
return -EINVAL;