comparison toys/chvt.c @ 246:d9ea4ca7ae8c

Have chvt print an error message (and exit with error) when it fails.
author Rob Landley <rob@landley.net>
date Sun, 27 Jan 2008 15:26:32 -0600
parents e6273440c9c0
children 17c0a2013852
comparison
equal deleted inserted replaced
245:67a0839bda77 246:d9ea4ca7ae8c
51 if(!*toys.optargs) return; 51 if(!*toys.optargs) return;
52 52
53 vtnum=atoi(*toys.optargs); 53 vtnum=atoi(*toys.optargs);
54 54
55 fd=get_console_fd(); 55 fd=get_console_fd();
56 if (fd < 0) return; 56 if (fd < 0 || ioctl(fd,VT_ACTIVATE,vtnum)
57 57 || ioctl(fd,VT_WAITACTIVE,vtnum))
58 if (ioctl(fd,VT_ACTIVATE,vtnum)) return; 58 {
59 59 perror_exit(NULL);
60 if (ioctl(fd,VT_WAITACTIVE,vtnum)) return; 60 }
61 } 61 }