[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

openpty and kfreebsd



Hi again,

the openpty internally uses fork() and wait().

And there is a problem with earlier "signal(SIGCHLD, SIG_IGN)",
as wait returns ECHILD. Please, could you alter source by:


--- src/hv.c~   2013-10-07 15:11:54.000000000 +0200
+++ src/hv.c    2013-10-07 15:35:36.000000000 +0200
@@ -156,15 +156,16 @@
                goto ret;
        }
 #endif
-       signal(SIGCHLD, SIG_IGN);
-       signal(SIGPIPE, SIG_IGN);
-
        memset(vpcs_list, 0, MAX_DAEMONS * sizeof(struct list));

        if (openpty(&ptyfdm, &ptyfds, NULL, NULL, NULL)) {
                perror("Create pseudo-terminal");
                goto ret;
        }
+
+       signal(SIGCHLD, SIG_IGN);
+       signal(SIGPIPE, SIG_IGN);
+
        fptys = fdopen(ptyfds, "w");

        rls = readline_init(50, 128);


Petr


Reply to: