I forgot to say in the man page that -b is useful only with the -w
option, so the new patch is attached.
Cheers,
Daniele
--
GPG Fingerprint: 7B1F 0815 BB7D CF35 1018 EEAB 4B97 6382 F151 402D
-
GPG Key [ID: 0xF151402D] available @ pgp.mit.edu
-------------
"The whole world is about three drinks behind."
-- Humphrey Bogart
diff -ruN console-tools-0.2.3-old/doc/man/openvt.1
console-tools-0.2.3/doc/man/openvt.1
--- console-tools-0.2.3-old/doc/man/openvt.1 2006-07-23 15:01:52.000000000
+0200
+++ console-tools-0.2.3/doc/man/openvt.1 2006-07-23 15:13:33.000000000
+0200
@@ -28,6 +28,10 @@
Switch to the new VT when starting the command. The VT of the new command
will be made the new current VT.
.TP
+.I "\-b"
+Switch back to the controlling terminal when the command completes.
+This is useful only with -w option.
+.TP
.I "\-u"
Figure out the owner of the current VT, and run login as that user.
Suitable to be called by init. Shouldn't be used with -c or -l.
@@ -40,9 +43,7 @@
Be a bit more verbose.
.TP
.I "\-w"
-wait for command to complete. If \-w and \-s are used together then
-.B openvt
-will switch back to the controlling terminal when the command completes.
+Wait for command to complete.
.TP
.I "\-\-"
end of options to
diff -ruN console-tools-0.2.3-old/vttools/openvt.c
console-tools-0.2.3/vttools/openvt.c
--- console-tools-0.2.3-old/vttools/openvt.c 2006-07-23 15:01:52.000000000
+0200
+++ console-tools-0.2.3/vttools/openvt.c 2006-07-23 15:10:12.000000000
+0200
@@ -92,6 +92,7 @@
int fd = -1;
char optc = FALSE;
char show = FALSE;
+ char back = FALSE;
char login = FALSE;
char force = FALSE;
char verbose = FALSE;
@@ -109,7 +110,7 @@
* as soon as a non-option argument is encountered. That way the
* child options are left intact.
*/
- while ((opt = getopt(argc, argv, "+c:lsvfuw")) != -1)
+ while ((opt = getopt(argc, argv, "+c:lsbvfuw")) != -1)
{
switch (opt)
{
@@ -130,6 +131,9 @@
case 's':
show = TRUE;
break;
+ case 'b':
+ back = TRUE;
+ break;
case 'v':
verbose = TRUE;
break;
@@ -355,7 +359,7 @@
if ( do_wait )
{
wait(NULL);
- if (show) /* Switch back... */
+ if (back) /* Switch back... */
{
(void) ioctl(fd, VT_ACTIVATE, vtstat.v_active);
/* wait to be really sure we have switched */