jed-users mailing list

[2009 Date Index] [2009 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: signal handler within jed?


Hallo Ulli,

Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx> wrote:
> I have problems with some of my users, who do not exit jed correctly, but
> click on the CLOSE button of the xterm window.
>
> Closing the xterm leads to a SIGTERM for jed. 

No. Start a jed in an XTerm and an strace for this jed in a different
terminal.

% strace -p 28787
Process 28787 attached - interrupt to quit
select(4, [2 3], NULL, NULL, {32, 901682}) = ? ERESTARTNOHAND (To be restarted)
--- SIGHUP (Hangup) @ 0 (0) ---
sigreturn()                             = ? (mask now ~[])
write(1, "\33[24;1H\33[33mautosaving..."..., 25) = 25

It get's a SIGHUP.

But there's a bug:

ioctl(2, TCGETS, 0xbff9c164)            = -1 EIO (Input/output error)
ioctl(2, TCSETSW, {B38400 opost isig icanon echo ...}) = -1 EIO (Input/output er
ror)
write(2, "***Fatal Error: Killed by signal "..., 37) = -1 EIO (Input/output erro
r)
write(2, "jed version: 0.99.19-175/Unix\n"..., 30) = -1 EIO (Input/output error)
write(2, " Compiled with GNU C 4.3"..., 24) = -1 EIO (Input/output error)
write(2, "\n"..., 1)                    = -1 EIO (Input/output error)
write(2, "S-Lang version: 2.1.3\n"..., 22) = -1 EIO (Input/output error)
write(2, "\njed compile-time options:\n"..., 27) = -1 EIO (Input/output error)
write(2, " +LINE_ATTRIBUTES"..., 17)    = -1 EIO (Input/output error)
write(2, " +BUFFER_LOCAL_VARS"..., 19)  = -1 EIO (Input/output error)
write(2, " +SAVE_NARROW"..., 13)        = -1 EIO (Input/output error)
write(2, " +TTY_MENUS"..., 11)          = -1 EIO (Input/output error)
write(2, "\n"..., 1)                    = -1 EIO (Input/output error)
write(2, " +EMACS_LOCKING"..., 15)      = -1 EIO (Input/output error)
write(2, " +MULTICLICK"..., 12)         = -1 EIO (Input/output error)
write(2, " +SUBPROCESSES"..., 14)       = -1 EIO (Input/output error)
write(2, " +DFA_SYNTAX"..., 12)         = -1 EIO (Input/output error)
write(2, " +ABBREVS"..., 9)             = -1 EIO (Input/output error)
write(2, "\n"..., 1)                    = -1 EIO (Input/output error)
write(2, " +COLOR_COLUMNS"..., 15)      = -1 EIO (Input/output error)
write(2, " +LINE_MARKS"..., 12)         = -1 EIO (Input/output error)
write(2, " +GPM_MOUSE"..., 11)          = -1 EIO (Input/output error)
write(2, " +IMPORT"..., 8)              = -1 EIO (Input/output error)
write(2, "\n"..., 1)                    = -1 EIO (Input/output error)
write(2, "CBuf: 0x200eb148, CLine: 0x2009f3"..., 45) = -1 EIO (Input/output erro
r)
write(2, "CLine: data: 0x200eb2a0, len = 11"..., 64) = -1 EIO (Input/output erro
r)
write(2, "Max_LineNum: 2, LineNum: 1\n"..., 27) = -1 EIO (Input/output error)
write(2, "JWindow: 0x200d73b8, top: 0, rows"..., 58) = -1 EIO (Input/output erro
r)

Jed doesn't handle the SIGHUP correctly, i.e. it should not complain it
was killed by it.

> Is it possible to install a signal handler within jed?

No, the signal() function from S‐Lang isn't exported to jed.

> In this signal handler routine I then could save all buffers.

I would much more prefer jed refuses to quit if there are buffers with
unsaved data and don't having the autosave flag.

BTW: This would be a workaround for you: set the autosave flag for all
buffers. see getbuf_info()

Schöne Grüße, Jörg.
-- 
Dadurch, dass man einen anderen ins Irrenhaus sperrt,
beweist man noch nicht seinen eigenen Verstand.

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2009 date index] [2009 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]