From 1e164f6a66538b6f86b05aeb2f145b5cf507abdf Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 20 Nov 2009 04:03:45 +0000 Subject: [PATCH] * Silence warn_unused_result in setup.c --- webcit/setup.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/webcit/setup.c b/webcit/setup.c index f93abb22d..12a50dda4 100644 --- a/webcit/setup.c +++ b/webcit/setup.c @@ -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://:/"); + 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, -- 2.39.2