This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: readline messing with SA_RESTART for SIGWINCH


Mikael Djurfeldt wrote:
> If anyone provides the code for rl_pre_input_hook and a test for
> configure (code is sufficient), then I'll include it in the 1.4
> release.

Ok, here is a test to see if readline turns off SA_RESTART.

You should of course already know that you have readline and SA_RESTART.

-Dale
-- 
Dale P. Smith
Altus Technologies Corp.
dsmith@altustech.com
400-746-9000 x309
#include <signal.h>
#include <stdio.h>
#include <readline/readline.h>

int hook(void) {
    struct sigaction action;

    sigaction (SIGWINCH, NULL, &action);
    rl_cleanup_after_signal();

    /* exit with 0 if readline did not disable SA_RESTART */
    exit(!(action.sa_flags & SA_RESTART));
}
    
int main() {
    struct sigaction action;

    sigaction (SIGWINCH, NULL, &action);
    action.sa_flags |= SA_RESTART;
    sigaction (SIGWINCH, &action, NULL);

    rl_pre_input_hook = hook;
    readline ("");
}

    
    

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]