* Silence warn_unused_result in setup.c
authorArt Cancro <ajc@citadel.org>
Fri, 20 Nov 2009 04:03:45 +0000 (04:03 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 20 Nov 2009 04:03:45 +0000 (04:03 +0000)
webcit/setup.c

index f93abb22dc25942e38ba1279fc01bf856e84bf60..12a50dda4aef03592bc6489c7e044ffa9a24b46c 100644 (file)
@@ -55,6 +55,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 +87,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 +216,7 @@ void set_value(char *prompt, char str[])
        char dialog_result[PATH_MAX];
        char setupmsg[SIZ];
        FILE *fp;
+       int rv;
 
        strcpy(setupmsg, "");
 
@@ -237,7 +239,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 +266,7 @@ int GetLocalePrefs(void)
        FILE *fp;
        int i = 0;
        int offs = 0;
+       int rv;
 
 
        nLocales = 0; 
@@ -299,7 +302,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 +324,7 @@ int GetLocalePrefs(void)
 void important_message(char *title, char *msgtext)
 {
        char buf[SIZ];
+       int rv;
 
        switch (setup_type) {
 
@@ -335,7 +339,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 +435,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 +637,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);
 
 }
 
@@ -667,6 +672,7 @@ int main(int argc, char *argv[])
        char aaa[256];
        int info_only = 0;
        strcpy(suggested_url, "http://<your_host_name>:<port>/");
+       int rv;
 
        /* set an invalid setup type */
        setup_type = (-1);
@@ -743,8 +749,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,