summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-01 19:54:46 +0000
committerRoy Marples <roy@marples.name>2008-02-01 19:54:46 +0000
commitfef5d0af591c6c8a91f69bba5e62c99df1a732c9 (patch)
tree8a3709e9e00a84f8211a6816afaf27d3166d8d76
parentf12f3e0641430b9011e21e2ba7781035d545b4ed (diff)
downloadopenrc-fef5d0af591c6c8a91f69bba5e62c99df1a732c9.tar.gz
openrc-fef5d0af591c6c8a91f69bba5e62c99df1a732c9.tar.bz2
openrc-fef5d0af591c6c8a91f69bba5e62c99df1a732c9.tar.xz
Constantise as much as possible so that it reduces COW usage.
-rw-r--r--src/librc/librc-depend.c2
-rw-r--r--src/rc/checkpath.c2
-rw-r--r--src/rc/fstabinfo.c2
-rw-r--r--src/rc/mountinfo.c2
-rw-r--r--src/rc/rc-depend.c2
-rw-r--r--src/rc/rc-status.c2
-rw-r--r--src/rc/rc-update.c2
-rw-r--r--src/rc/rc.c2
-rw-r--r--src/rc/runscript.c2
-rw-r--r--src/rc/start-stop-daemon.c2
10 files changed, 10 insertions, 10 deletions
diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c
index 6e6847a..d74fd34 100644
--- a/src/librc/librc-depend.c
+++ b/src/librc/librc-depend.c
@@ -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",
diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 74bed53..5178032 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -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'},
diff --git a/src/rc/fstabinfo.c b/src/rc/fstabinfo.c
index 4b674bc..446f9be 100644
--- a/src/rc/fstabinfo.c
+++ b/src/rc/fstabinfo.c
@@ -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' },
diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c
index 0d8d7a1..b15a50a 100644
--- a/src/rc/mountinfo.c
+++ b/src/rc/mountinfo.c
@@ -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'},
diff --git a/src/rc/rc-depend.c b/src/rc/rc-depend.c
index be998c4..0bb4c21 100644
--- a/src/rc/rc-depend.c
+++ b/src/rc/rc-depend.c
@@ -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'},
diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c
index 9282248..0b2b3ec 100644
--- a/src/rc/rc-status.c
+++ b/src/rc/rc-status.c
@@ -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)
{
diff --git a/src/rc/rc-update.c b/src/rc/rc-update.c
index 72b94a3..38d4242 100644
--- a/src/rc/rc-update.c
+++ b/src/rc/rc-update.c
@@ -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[] = {
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 954d6b5..f093b87 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -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
};
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index 458ecd2..dfabb86 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -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'},
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index 43d1d3d..5a524d9 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -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'},