Re: /usr/src/etc/rc.d/moused patch

看板DFBSD_submit作者時間21年前 (2004/04/29 10:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串6/10 (看更多)
This is a multi-part message in MIME format. --------------070409020707060409070005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit YONETANI Tomokazu wrote: > The ioctl request for showing/hiding mouse cursor returns an error > if the mouse cursor is already in the requested state. The recent > big change to vidcontrol(8) changed the way it handles the failed > operations and tries to revert the original configuration as much > as possible, with a small side-effect of showing a false alert. > You've never seen an error with the previous version of vidcontrol > because it simply discarded the error returned by ioctl(). > You can either fix vidcontrol to not show the error message, or > change syscons driver to not return EINVAL, but IMHO the latter > looks more correct. I think having syscons return an error (current behavior) is correct. It is /usr/src/etc/rc.d/moused which is buggy. It calls vidcontrol twelve times where once would be enough. It also doesn't stop moused when it is given a "stop" argument. This causes "/usr/etc/rc.d/moused restart" to fail because restart just does a stop (moused is not stopped) and a start (mouse already on -> error message). Both changes are enough to stop all of vidcontrol's error messages on my system. They are in my patch which is at the beginning of this thread and which walt is for some reason unable to apply. So he misses the moused_stop routine and still gets an error with "moused restart". I've attached the patch again. Could someone else please try to apply my patch? :) It really contains the correct solution. Why _not_ have syscons report an error if the mouse is already on and the user tries to turn it on? Regards, Sascha -- http://yoyodyne.ath.cx --------------070409020707060409070005 Content-Type: text/plain; name="moused.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="moused.patch" *** /usr/src/etc/rc.d/moused Tue Apr 27 18:08:53 2004 --- /usr/s/src/etc/rc.d/moused Tue Apr 27 18:08:26 2004 *************** *** 15,20 **** --- 15,26 ---- rcvar=`set_rcvar` command="/usr/sbin/${name}" start_cmd="moused_start" + stop_cmd="moused_stop" + sig_stop="-INT" + + # stdin must be redirected because it might be for a serial console + # + viddev=/dev/ttyv0 moused_start() { *************** *** 31,41 **** ;; esac ! for ttyv in /dev/ttyv* ; do ! vidcontrol < ${ttyv} ${_mousechar_arg} -m on ! done echo '.' } load_rc_config $name run_rc_command "$1" --- 37,56 ---- ;; esac ! vidcontrol < ${viddev} ${_mousechar_arg} -m on ! echo '.' } + moused_stop() + { + pids="`check_process $command`" + if [ -n "$pids" ]; then + for pid in $pids; do + kill $sig_stop $pid + done + fi + } + load_rc_config $name run_rc_command "$1" --------------070409020707060409070005--
文章代碼(AID): #10a68F00 (DFBSD_submit)
討論串 (同標題文章)
文章代碼(AID): #10a68F00 (DFBSD_submit)