Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Dec 2010 18:52:32 GMT
From:      David Demelier <demelier.david@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/153052: watch(8) breaks tty on error
Message-ID:  <201012121852.oBCIqWSj069390@red.freebsd.org>
Resent-Message-ID: <201012121900.oBCJ0J0A056676@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         153052
>Category:       misc
>Synopsis:       watch(8) breaks tty on error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 12 19:00:19 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     David Demelier
>Release:        8.2-PRERELEASE
>Organization:
>Environment:
FreeBSD Melon.malikania.fr 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #7: Wed Dec  8 14:03:55 CET 2010     root@Melon.malikania.fr:/usr/obj/usr/src/sys/Melon  amd64

>Description:
When you run watch and snp module is not loaded (or probably any other error) watch breaks the terminal

I have removed unset_tty() and seems to work in my case, but I can't test for the others fatal() calls.

markand@Melon /usr/src/usr.sbin/watch $ watch
watch: snp module not available: Operation not permitted
watch: fatal: cannot open snoop device
                                      %                                                                                                                                                           markand@Melon /usr/src/usr.sbin/watch $ ls
Makefile     watch.8      watch.c      watch.c.orig
                                                   % 

markand@Melon /usr/src/usr.sbin/watch $ ls -l
total 26
        -rw-r--r--  1 root  wheel   187  3 Aug  2009 Makefile
                                                             -rw-r--r--  1 root  wheel  2645  3 Aug  2009 watch.8
                                                                                                                 -rw-r--r--  1 root  wheel  9042 12 Dec 19:46 watch.c
                                                                                                                                                                     -rw-r--r--  1 root  wheel  9042 12 Dec 19:38 watch.c.orig
                            % 
>How-To-Repeat:

>Fix:
-- watch.c.diff begins here --
--- watch.c.orig	2010-12-12 19:38:27.000000000 +0100
+++ watch.c	2010-12-12 19:44:21.000000000 +0100
@@ -142,7 +142,6 @@
 static void
 fatal(int error, const char *buf)
 {
-	unset_tty();
 	if (buf)
 		errx(error, "fatal: %s", buf);
 	else
-- watch.d.diff ends here --

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012121852.oBCIqWSj069390>