]> code.citadel.org Git - citadel.git/blobdiff - citadel/citadel.c
* support autoconf 2.53
[citadel.git] / citadel / citadel.c
index 7f5b7dd43ec84b4e3e34e760a99d7f4aa8c3fc53..09961d8ebbf31df8eb48ef653693096a90f1bc43 100644 (file)
@@ -689,13 +689,10 @@ void check_screen_dims(void)
                unsigned short ypixels;         /* pixels */
        } xwinsz;
 
-       if (scr_set_windowsize())
-               return;
-
        if (have_xterm) {       /* dynamically size screen if on an xterm */
                if (ioctl(0, TIOCGWINSZ, &xwinsz) == 0) {
                        if (xwinsz.height)
-                               screenheight = (int) xwinsz.height;
+                               screenheight = is_curses_enabled() ? (int)xwinsz.height - 1 : (int) xwinsz.height;
                        if (xwinsz.width)
                                screenwidth = (int) xwinsz.width;
                }
@@ -921,6 +918,11 @@ int shift(int argc, char **argv, int start, int count) {
        return argc;
 }
 
+static void statusHook(char *s) {
+       sln_printf(s);
+       sln_flush();
+}
+
 /*
  * main
  */
@@ -935,6 +937,10 @@ int main(int argc, char **argv)
        char hexstring[MD5_HEXSTRING_SIZE];
        int stored_password = 0;
        char password[SIZ];
+
+       setIPCDeathHook(screen_delete);
+       setIPCErrorPrintf(err_printf);
+       setCryptoStatusHook(statusHook);
        
        /* Permissions sanity check - don't run citadel setuid/setgid */
        if (getuid() != geteuid()) {
@@ -950,7 +956,10 @@ int main(int argc, char **argv)
        sttybbs(SB_NO_INTR);    /* Install the new ones */
        signal(SIGHUP, dropcarr);       /* Cleanup gracefully if carrier is dropped */
        signal(SIGTERM, dropcarr);      /* Cleanup gracefully if terminated */
-       signal(SIGCONT, catch_sigcont);         /* Catch SIGCONT so we can reset terminal */
+       signal(SIGCONT, catch_sigcont); /* Catch SIGCONT so we can reset terminal */
+#ifdef SIGWINCH
+       signal(SIGWINCH, scr_winch);    /* Window resize signal */
+#endif
 
 #ifdef HAVE_OPENSSL
        arg_encrypt = RC_DEFAULT;