Remove $Id$ tags from most of webcit
[citadel.git] / webcit / setup.c
index f93abb22dc25942e38ba1279fc01bf856e84bf60..8e4e733f0778f5b3a4f796d5f80b830681a07797 100644 (file)
@@ -1,10 +1,7 @@
 /*
- * $Id$
- *
  * WebCit setup utility
  * 
  * (This is basically just an install wizard.  It's not required.)
- *
  */
 
 #include "sysdep.h"
@@ -55,6 +52,7 @@ void delete_init_entry(char *which_entry)
        char levels[SIZ];
        char state[SIZ];
        char prog[SIZ];
+       int rv;
 
        inittab = strdup("");
        if (inittab == NULL) return;
@@ -86,7 +84,7 @@ void delete_init_entry(char *which_entry)
        fclose(fp);
        fp = fopen("/etc/inittab", "w");
        if (fp != NULL) {
-               fwrite(inittab, strlen(inittab), 1, fp);
+               rv = fwrite(inittab, strlen(inittab), 1, fp);
                fclose(fp);
                kill(1, SIGHUP);        /* Tell init to re-read /etc/inittab */
        }
@@ -215,6 +213,7 @@ void set_value(char *prompt, char str[])
        char dialog_result[PATH_MAX];
        char setupmsg[SIZ];
        FILE *fp;
+       int rv;
 
        strcpy(setupmsg, "");
 
@@ -237,7 +236,7 @@ void set_value(char *prompt, char str[])
                        prompt,
                        str,
                        dialog_result);
-               system(buf);
+               rv = system(buf);
                fp = fopen(dialog_result, "r");
                if (fp != NULL) {
                        if (fgets(str, sizeof buf, fp)){
@@ -264,6 +263,7 @@ int GetLocalePrefs(void)
        FILE *fp;
        int i = 0;
        int offs = 0;
+       int rv;
 
 
        nLocales = 0; 
@@ -299,7 +299,7 @@ int GetLocalePrefs(void)
                        ChrPtr(Buf),
                        0L,
                        dialog_result);
-               system(buf);
+               rv = system(buf);
                fp = fopen(dialog_result, "r");
                if (fp != NULL) {
                        char *str = &buf[0];
@@ -321,6 +321,7 @@ int GetLocalePrefs(void)
 void important_message(char *title, char *msgtext)
 {
        char buf[SIZ];
+       int rv;
 
        switch (setup_type) {
 
@@ -335,7 +336,7 @@ void important_message(char *title, char *msgtext)
                sprintf(buf, "exec %s --msgbox '%s' 19 72",
                        getenv("CTDL_DIALOG"),
                        msgtext);
-               system(buf);
+               rv = system(buf);
                break;
        }
 }
@@ -431,6 +432,7 @@ void install_init_scripts(void)
        struct stat etcinitd;
        FILE *fp;
        char *initfile = "/etc/init.d/webcit";
+       int rv;
 
        fp = fopen(initfile, "r");
        if (fp != NULL) {
@@ -632,11 +634,11 @@ void install_init_scripts(void)
        chmod(initfile, 0755);
 
        /* Set up the run levels. */
-       system("/bin/rm -f /etc/rc?.d/[SK]??webcit 2>/dev/null");
+       rv = system("/bin/rm -f /etc/rc?.d/[SK]??webcit 2>/dev/null");
        snprintf(command, sizeof(command), "for x in 2 3 4 5 ; do [ -d /etc/rc$x.d ] && ln -s %s /etc/rc$x.d/S84webcit ; done 2>/dev/null", initfile);
-       system(command);
+       rv = system(command);
        snprintf(command, sizeof(command), "for x in 0 6 S; do [ -d /etc/rc$x.d ] && ln -s %s /etc/rc$x.d/K15webcit ; done 2>/dev/null", initfile);
-       system(command);
+       rv = system(command);
 
 }
 
@@ -666,6 +668,8 @@ int main(int argc, char *argv[])
        int a;
        char aaa[256];
        int info_only = 0;
+       int rv;
+
        strcpy(suggested_url, "http://<your_host_name>:<port>/");
 
        /* set an invalid setup type */
@@ -743,8 +747,8 @@ int main(int argc, char *argv[])
                install_init_scripts();
 
                if (!access("/etc/init.d/webcit", X_OK)) {
-                       system("/etc/init.d/webcit stop");
-                       system("/etc/init.d/webcit start");
+                       rv = system("/etc/init.d/webcit stop");
+                       rv = system("/etc/init.d/webcit start");
                }
 
                sprintf(aaa,