]> code.citadel.org Git - citadel.git/blobdiff - webcit/setup.c
Conditional_USER_HAS_PIC() was leaving the download file open, causing the actual...
[citadel.git] / webcit / setup.c
index 2eaeae5b74c193dad9e006e121090fc0b7af361d..c5927f05a2cc49c9f9e1609219a44405819ff52c 100644 (file)
@@ -1,10 +1,7 @@
 /*
- * $Id$
- *
  * WebCit setup utility
  * 
  * (This is basically just an install wizard.  It's not required.)
- *
  */
 
 #include "sysdep.h"
@@ -21,17 +18,19 @@ char setup_directory[SIZ];
 int using_web_installer = 0;
 char suggested_url[SIZ];
 
-/* some copies... */
-int lprintf(int loglevel, const char *format, ...){return 0;}
+/* some copies... 
+int syslog(int loglevel, const char *format, ...){return 0;} */
+void wc_printf(const char *format,...){}
+
 void RegisterNS(const char *NSName, long len, 
                int nMinArgs, 
                int nMaxArgs, 
                WCHandlerFunc HandlerFunc,
+               WCPreevalFunc PreEvalFunc,
                int ContextRequired){}
+void RegisterHeaderHandler(const char *Name, long Len, Header_Evaluator F){}
 pthread_key_t MyConKey;
 
-#include "wc_gettext.h"
-
 #ifdef ENABLE_NLS
 
 #ifdef HAVE_USELOCALE 
@@ -53,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;
@@ -84,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 */
        }
@@ -213,6 +213,7 @@ void set_value(char *prompt, char str[])
        char dialog_result[PATH_MAX];
        char setupmsg[SIZ];
        FILE *fp;
+       int rv;
 
        strcpy(setupmsg, "");
 
@@ -235,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)){
@@ -252,7 +253,7 @@ void set_value(char *prompt, char str[])
 }
 
 
-extern char **AvailLang;
+extern const char *AvailLang[];
 int GetLocalePrefs(void)
 {
        int nLocales;
@@ -262,6 +263,7 @@ int GetLocalePrefs(void)
        FILE *fp;
        int i = 0;
        int offs = 0;
+       int rv;
 
 
        nLocales = 0; 
@@ -297,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];
@@ -319,6 +321,7 @@ int GetLocalePrefs(void)
 void important_message(char *title, char *msgtext)
 {
        char buf[SIZ];
+       int rv;
 
        switch (setup_type) {
 
@@ -333,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;
        }
 }
@@ -429,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) {
@@ -630,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);
 
 }
 
@@ -664,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 */
@@ -741,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,