public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Steigerwald <Martin@lichtvoll.de>
To: util-linux@vger.kernel.org, Andreas Henriksson <andreas@fatal.se>
Subject: Re: [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C
Date: Mon, 04 Aug 2014 14:01:42 +0200	[thread overview]
Message-ID: <1469621.AbYYNxNq4q@merkaba> (raw)
In-Reply-To: <2432624.0NNcbHJWc6@merkaba>

[-- Attachment #1: Type: text/plain, Size: 3046 bytes --]

Am Montag, 4. August 2014, 13:53:34 schrieb Martin Steigerwald:
> Am Montag, 4. August 2014, 13:28:11 schrieben Sie:
> > According to curs_set(0) in ui_init() I think curs_set(1) belongs into
> > ui_end with in die_on_signal() also gets called on SIGINT or SIGTERM.
> > 
> > This should complete the fix made by Andreas in commit 4f4daf8f.
> > 
> > I could not yet test the fix as building current git fails with:
> > 
> > /usr/bin/ld: sys-utils/swapoff-swapon-common.o: undefined reference to
> > symbol 'blkid_probe_lookup_value@@BLKID_2.15'
> > //home/martin/Linux/util-linux/util-linux/.libs/libblkid.so.1: error
> > adding
> > symbols: DSO missing from command line
> > 
> > Will test as soon as I found out how to fix this build issue. Benno
> > reported it already on mailing list.
> > 
> > Addresses-Debian-Bug: #757000
> > BCC´d there for reference.
> 
> Scratch that.
> 
> Fix doesn´t work.
> 
> Cursor is displayed on regular end, but not on Ctrl-C.
> 
> Don´t get why tough.

Patch may still be correct, but SIGINT handler is broke:

martin@merkaba:~/Linux/util-linux/util-linux> sudo ./cfdisk [quitted] 
regularily]         
ui_end called!
martin@merkaba:~/Linux/util-linux/util-linux> sudo ./cfdisk [Ctrl-C]
martin@merkaba:~/Linux/util-linux/util-linux#2>

Its supposed to call ui_end(); but doesnt as above example demonstrates.


 785 static int ui_init(struct cfdisk *cf __attribute__((__unused__)))
 786 {
 787 »·······struct sigaction sa;
 788 
 789 »·······DBG(FRONTEND, ul_debug("ui: init"));
 790 
 791 »·······/* setup SIGCHLD handler */
 792 »·······sigemptyset(&sa.sa_mask);
 793 »·······sa.sa_flags = 0;
 794 »·······sa.sa_handler = die_on_signal;
 795 »·······sigaction(SIGINT, &sa, NULL);                                                                                                             
 796 »·······sigaction(SIGTERM, &sa, NULL);


 662 static void die_on_signal(int dummy __attribute__((__unused__)))
 663 {                                                                                                                                                 
 664 »·······DBG(FRONTEND, ul_debug("die on signal."));
 665 »·······ui_end();
 666 »·······exit(EXIT_FAILURE);
 667 }


 517 static int ui_end(void)
 518 {
 519 »·······if (!ui_enabled)
 520 »·······»·······return -EINVAL;                                                                                                                   
 521 
 522 #if defined(HAVE_SLCURSES_H) || defined(HAVE_SLANG_SLCURSES_H)
 523 »·······SLsmg_gotorc(LINES - 1, 0);
 524 »·······SLsmg_refresh();
 525 #else
 526 »·······mvcur(0, COLS - 1, LINES-1, 0);
 527 #endif
 528 »·······printf("ui_end called!");
 529 »·······curs_set(1);
 530 »·······nl();
 531 »·······endwin();
 532 »·······printf("\n");
 533 »·······ui_enabled = 0;
 534 »·······return 0;
 535 }

Thanks,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2014-08-04 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 11:28 [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C Martin Steigerwald
2014-08-04 11:53 ` Martin Steigerwald
2014-08-04 12:01   ` Martin Steigerwald [this message]
2014-08-06 13:49     ` Karel Zak
2014-08-06 14:37       ` Martin Steigerwald
2014-08-06 17:15         ` Andreas Henriksson
  -- strict thread matches above, loose matches on Subject: below --
2014-08-04 11:31 Martin Steigerwald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469621.AbYYNxNq4q@merkaba \
    --to=martin@lichtvoll.de \
    --cc=andreas@fatal.se \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox