svn commit: r269460 - head/usr.sbin/bsdconfig/share

Devin Teske dteske at FreeBSD.org
Sun Aug 3 05:02:00 UTC 2014


Author: dteske
Date: Sun Aug  3 05:02:00 2014
New Revision: 269460
URL: http://svnweb.freebsd.org/changeset/base/269460

Log:
  Add required `exec' before Xdialog(1) invocation for the case where we
  expect (require) data on stdin. The effect of this is that, when
  backgrounded, $! returns the pid of an Xdialog(1) instance instead of
  an sh(1) instance -- the difference being a later kill of $! will reach
  the Xdialog(1) instance whereas without the exec the kill succeeds on
  the sh(1) instance leaving Xdialog(1) open.

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/dialog.subr	Sun Aug  3 05:00:43 2014	(r269459)
+++ head/usr.sbin/bsdconfig/share/dialog.subr	Sun Aug  3 05:02:00 2014	(r269460)
@@ -1557,12 +1557,22 @@ f_dialog_info()
 # EOF. This implies that you must execute this either as an rvalue to a pipe,
 # lvalue to indirection or in a sub-shell that provides data on stdin.
 #
+# To open an Xdialog(1) infobox that does not disappear until expeclitly dis-
+# missed, use the following:
+#
+# 	f_xdialog_info "$info_text" < /dev/tty &
+# 	pid=$!
+# 	# Perform some lengthy actions
+# 	kill $pid
+#
+# NB: Check $USE_XDIALOG if you need to support both dialog(1) and Xdialog(1).
+#
 f_xdialog_info()
 {
 	local info_text="$*" height width
 	f_dialog_infobox_size height width \
 		"$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$info_text"
-	$DIALOG \
+	exec $DIALOG \
 		--title "$DIALOG_TITLE"               \
 		--backtitle "$DIALOG_BACKTITLE"       \
 		--no-close --no-buttons               \


More information about the svn-src-all mailing list