scripts/kconfig/mconf: work on systems w/o SIGWINCH
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Sep 2012 13:26:40 +0000 (15:26 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Sep 2012 13:26:40 +0000 (15:26 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
scripts/kconfig/mconf.c

index 1b0b6ab..006d037 100644 (file)
@@ -445,6 +445,7 @@ static struct gstr get_relations_str(struct symbol **sym_arr)
 
 pid_t pid;
 
+#ifdef SIGWINCH
 static void winch_handler(int sig)
 {
        if (!do_resize) {
@@ -452,11 +453,11 @@ static void winch_handler(int sig)
                do_resize = 1;
        }
 }
+#endif
 
 static int exec_conf(void)
 {
        int pipefd[2], stat, size;
-       struct sigaction sa;
        sigset_t sset, osset;
 
        sigemptyset(&sset);
@@ -465,10 +466,15 @@ static int exec_conf(void)
 
        signal(SIGINT, SIG_DFL);
 
-       sa.sa_handler = winch_handler;
-       sigemptyset(&sa.sa_mask);
-       sa.sa_flags = SA_RESTART;
-       sigaction(SIGWINCH, &sa, NULL);
+#ifdef SIGWINCH
+       {
+               struct sigaction sa;
+               sa.sa_handler = winch_handler;
+               sigemptyset(&sa.sa_mask);
+               sa.sa_flags = SA_RESTART;
+               sigaction(SIGWINCH, &sa, NULL);
+       }
+#endif
 
        *argptr++ = NULL;