Constantise as much as possible so that it reduces COW usage.
This commit is contained in:
parent
f12f3e0641
commit
fef5d0af59
@ -661,7 +661,7 @@ static const deppair_t deppairs[] = {
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
static const char *depdirs[] =
|
||||
static const char *const depdirs[] =
|
||||
{
|
||||
RC_SVCDIR "/starting",
|
||||
RC_SVCDIR "/started",
|
||||
|
@ -161,7 +161,7 @@ static int parse_owner (struct passwd **user, struct group **group,
|
||||
#include "_usage.h"
|
||||
#define extraopts "path1 path2 ..."
|
||||
#define getoptstring "dfm:o:" getoptstring_COMMON
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "directory", 0, NULL, 'd'},
|
||||
{ "file", 0, NULL, 'f'},
|
||||
{ "mode", 1, NULL, 'm'},
|
||||
|
@ -90,7 +90,7 @@ static const char *applet = NULL;
|
||||
|
||||
#include "_usage.h"
|
||||
#define getoptstring "bmop:t:" getoptstring_COMMON
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "blockdevice", 0, NULL, 'b' },
|
||||
{ "options", 0, NULL, 'o' },
|
||||
{ "passno", 1, NULL, 'p' },
|
||||
|
@ -335,7 +335,7 @@ static regex_t *get_regex (const char *string)
|
||||
#include "_usage.h"
|
||||
#define extraopts "[mount1] [mount2] ..."
|
||||
#define getoptstring "f:F:n:N:o:O:p:P:ist" getoptstring_COMMON
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "fstype-regex", 1, NULL, 'f'},
|
||||
{ "skip-fstype-regex", 1, NULL, 'F'},
|
||||
{ "node-regex", 1, NULL, 'n'},
|
||||
|
@ -64,7 +64,7 @@ rc_depinfo_t *_rc_deptree_load (int *regen) {
|
||||
|
||||
#include "_usage.h"
|
||||
#define getoptstring "t:suT" getoptstring_COMMON
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "type", 1, NULL, 't'},
|
||||
{ "notrace", 0, NULL, 'T'},
|
||||
{ "strict", 0, NULL, 's'},
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
static const char *applet;
|
||||
|
||||
static const char *types_nua[] = { "ineed", "iuse", "iafter", NULL };
|
||||
static const char *const types_nua[] = { "ineed", "iuse", "iafter", NULL };
|
||||
|
||||
static void print_level (char *level)
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ static void show (char **runlevels, bool verbose)
|
||||
" rc-update [options] del service <runlevel>\n" \
|
||||
" rc-update [options] show"
|
||||
#define getoptstring getoptstring_COMMON
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
longopts_COMMON
|
||||
};
|
||||
static const char * const longopts_help[] = {
|
||||
|
@ -636,7 +636,7 @@ static void do_coldplug (void)
|
||||
|
||||
#include "_usage.h"
|
||||
#define getoptstring "o:" getoptstring_COMMON
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "override", 1, NULL, 'o' },
|
||||
longopts_COMMON
|
||||
};
|
||||
|
@ -1027,7 +1027,7 @@ static void svc_restart (bool deps)
|
||||
#include "_usage.h"
|
||||
#define getoptstring "dDsv" getoptstring_COMMON
|
||||
#define extraopts "stop | start | restart | describe | zap"
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "debug", 0, NULL, 'd'},
|
||||
{ "ifstarted", 0, NULL, 's'},
|
||||
{ "nodeps", 0, NULL, 'D'},
|
||||
|
@ -487,7 +487,7 @@ static void handle_signal (int sig)
|
||||
|
||||
#include "_usage.h"
|
||||
#define getoptstring "KN:R:Sbc:d:g:mn:op:s:tu:r:x:1:2:" getoptstring_COMMON
|
||||
static struct option longopts[] = {
|
||||
static const struct option longopts[] = {
|
||||
{ "stop", 0, NULL, 'K'},
|
||||
{ "nicelevel", 1, NULL, 'N'},
|
||||
{ "retry", 1, NULL, 'R'},
|
||||
|
Loading…
Reference in New Issue
Block a user