version 1.27, 2003/07/07 21:36:52 |
version 1.28, 2003/08/21 08:14:50 |
|
|
#include <ctype.h> |
#include <ctype.h> |
#include <signal.h> |
#include <signal.h> |
#include <string.h> |
#include <string.h> |
|
#include <poll.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
|
|
rundisplay(void) |
rundisplay(void) |
{ |
{ |
static char tempbuf1[50], tempbuf2[50]; |
static char tempbuf1[50], tempbuf2[50]; |
struct timeval timeout; |
|
fd_set readfds; |
|
sigset_t mask; |
sigset_t mask; |
char ch, *iptr; |
char ch, *iptr; |
int change, i; |
int change, i; |
|
struct pollfd pfd[1]; |
uid_t uid; |
uid_t uid; |
static char command_chars[] = "\f qh?en#sdkriIuSo"; |
static char command_chars[] = "\f qh?en#sdkriIuSo"; |
|
|
|
|
* set up arguments for select with |
* set up arguments for select with |
* timeout |
* timeout |
*/ |
*/ |
FD_ZERO(&readfds); |
pfd[0].fd = STDIN_FILENO; |
FD_SET(STDIN_FILENO, &readfds); |
pfd[0].events = POLLIN; |
timeout.tv_sec = (long) delay; |
|
timeout.tv_usec = (long) ((delay - timeout.tv_sec) * 1000000); |
|
|
|
if (leaveflag) { |
if (leaveflag) { |
end_screen(); |
end_screen(); |
|
|
* wait for either input or the end |
* wait for either input or the end |
* of the delay period |
* of the delay period |
*/ |
*/ |
if (select(STDIN_FILENO + 1, &readfds, (fd_set *) NULL, |
if (poll(pfd, 1, delay * 1000) > 0) { |
(fd_set *) NULL, &timeout) > 0) { |
|
char *errmsg; |
char *errmsg; |
int newval; |
int newval; |
|
|