All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C
@ 2014-08-04 11:28 Martin Steigerwald
  2014-08-04 11:53 ` Martin Steigerwald
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Steigerwald @ 2014-08-04 11:28 UTC (permalink / raw)
  To: util-linux

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

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.
---
 disk-utils/cfdisk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index dfdaaf0..536132a 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -525,6 +525,7 @@ static int ui_end(void)
 #else
        mvcur(0, COLS - 1, LINES-1, 0);
 #endif
+       curs_set(1);
        nl();
        endwin();
        printf("\n");
@@ -1966,7 +1967,6 @@ static int ui_run(struct cfdisk *cf)
 
        menu_pop(cf);
 
-       curs_set(1);
        DBG(FRONTEND, ul_debug("ui: end"));
 
        return 0;
-- 
2.0.1


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 --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Steigerwald @ 2014-08-04 11:53 UTC (permalink / raw)
  To: util-linux

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

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.

-- 
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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C
  2014-08-04 11:53 ` Martin Steigerwald
@ 2014-08-04 12:01   ` Martin Steigerwald
  2014-08-06 13:49     ` Karel Zak
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Steigerwald @ 2014-08-04 12:01 UTC (permalink / raw)
  To: util-linux, Andreas Henriksson

[-- 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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C
  2014-08-04 12:01   ` Martin Steigerwald
@ 2014-08-06 13:49     ` Karel Zak
  2014-08-06 14:37       ` Martin Steigerwald
  0 siblings, 1 reply; 7+ messages in thread
From: Karel Zak @ 2014-08-06 13:49 UTC (permalink / raw)
  To: Martin Steigerwald; +Cc: util-linux, Andreas Henriksson

On Mon, Aug 04, 2014 at 02:01:42PM +0200, Martin Steigerwald wrote:
> > 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:

hmm...

I have moved curs_set() to ui_end(), because you're right that the patch 
seems correct (although it's unnecessary for ncurses).

BTW, does it mean that Debian uses slang by default? Why? IMHO ncurses
is better :-)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C
  2014-08-06 13:49     ` Karel Zak
@ 2014-08-06 14:37       ` Martin Steigerwald
  2014-08-06 17:15         ` Andreas Henriksson
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Steigerwald @ 2014-08-06 14:37 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, Andreas Henriksson

Am Mittwoch, 6. August 2014, 15:49:12 schrieb Karel Zak:
> On Mon, Aug 04, 2014 at 02:01:42PM +0200, Martin Steigerwald wrote:
> > > 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:
> hmm...
> 
> I have moved curs_set() to ui_end(), because you're right that the patch
> seems correct (although it's unnecessary for ncurses).
> 
> BTW, does it mean that Debian uses slang by default? Why? IMHO ncurses
> is better :-)

Yes, it does. Why? I don´t know. Maybe Andreas who maintained the util-linux 
2.25 update into Debian´s before highly outdated util-linux package knows 
more. Andreas?

Any hint about the SIGINT handler issue? It doesn´t appear to get called at 
all.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C
  2014-08-06 14:37       ` Martin Steigerwald
@ 2014-08-06 17:15         ` Andreas Henriksson
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Henriksson @ 2014-08-06 17:15 UTC (permalink / raw)
  To: Martin Steigerwald; +Cc: Karel Zak, util-linux

Hello Karel Zak, Martin Steigerwald!

On Wed, Aug 06, 2014 at 04:37:38PM +0200, Martin Steigerwald wrote:
> Am Mittwoch, 6. August 2014, 15:49:12 schrieb Karel Zak:
[...]
> > BTW, does it mean that Debian uses slang by default? Why? IMHO ncurses
> > is better :-)
> 
> Yes, it does. Why? I don´t know. Maybe Andreas who maintained the util-linux 
> 2.25 update into Debian´s before highly outdated util-linux package knows 
> more. Andreas?
[...]

As Martin already mentioned and you might already be aware of, Debian
ships a really old version of util-linux. On top of this there seems
to have been basically no bug triaging done for the past decade.

As I see it one of the main reasons for this is that the Debian maintainers
backed themselves into a corner with how they worked and the main person
losing interest.

I've been working since a while to try to eliminate the gigantic hurdle
built up over a long time so we can (continuously) update the package
again in Debian. (The update from 2.20.1 -> 2.24.2 alone solved ~ 100 bugs
reported to the debian bug tracking system.)
(My updated package is currently sitting in Debian Experimental, so is only
available to those that explicitly add that repository and explicitly
install the new util-linux package from there as Martin have done.)

Over to slang, yes the Debian package of util-linux uses slang by default.
This is mostly for historic reasons and it's on the TODO list to change
to ncurses (which has been attempted once before prior to my involvement,
but then switched back).
Special considerations are needed to investigate the impact this has on
the debian-installer.
Because of these special considerations, I've punted the slang/ncurses
switch for now and hope to resolve the first part (continuous updates)
first.

If anyone is interested in more background info, please feel free to ask.

Finally, while we're talking about Debian I'll take the chance to mention
that it would be very appreciated if anyone wants to help me out with
some of the remaining bugs!
(There are still > 100 bugs open in the Debian bug tracking system.)

For the complete list:
http://bugs.debian.org/src:util-linux

For a filtered list with only the ones I've tagged "upstream":
http://bugs.debian.org/src:util-linux;include=tags:upstream

(For those unfamiliar with Debian BTS, please note that the webpages
are "read-only". Compare with eg. a mailing list archive. All interactions
are done via email.)


Regards,
Andreas Henriksson

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] Fix re-enabling of cursor with slang also after pressing Ctrl-C
@ 2014-08-04 11:31 Martin Steigerwald
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Steigerwald @ 2014-08-04 11:31 UTC (permalink / raw)
  To: util-linux

Hmmm, in case GPG signing messes up processing by git, here unsigned

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.
---
 disk-utils/cfdisk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index dfdaaf0..536132a 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -525,6 +525,7 @@ static int ui_end(void)
 #else
        mvcur(0, COLS - 1, LINES-1, 0);
 #endif
+       curs_set(1);
        nl();
        endwin();
        printf("\n");
@@ -1966,7 +1967,6 @@ static int ui_run(struct cfdisk *cf)
 
        menu_pop(cf);
 
-       curs_set(1);
        DBG(FRONTEND, ul_debug("ui: end"));
 
        return 0;
-- 
2.0.1


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-06 17:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2014-08-06 13:49     ` Karel Zak
2014-08-06 14:37       ` Martin Steigerwald
2014-08-06 17:15         ` Andreas Henriksson
2014-08-04 11:31 Martin Steigerwald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.