# HG changeset patch # User Rob Landley # Date 1201469192 21600 # Node ID d9ea4ca7ae8c7b167dd2e549f04f15ff047f6b9f # Parent 67a0839bda77b8b8a15468762b68ff031e043141 Have chvt print an error message (and exit with error) when it fails. diff -r 67a0839bda77 -r d9ea4ca7ae8c toys/chvt.c --- a/toys/chvt.c Sun Jan 27 15:26:08 2008 -0600 +++ b/toys/chvt.c Sun Jan 27 15:26:32 2008 -0600 @@ -53,9 +53,9 @@ vtnum=atoi(*toys.optargs); fd=get_console_fd(); - if (fd < 0) return; - - if (ioctl(fd,VT_ACTIVATE,vtnum)) return; - - if (ioctl(fd,VT_WAITACTIVE,vtnum)) return; + if (fd < 0 || ioctl(fd,VT_ACTIVATE,vtnum) + || ioctl(fd,VT_WAITACTIVE,vtnum)) + { + perror_exit(NULL); + } }