ALT Linux Bugzilla
– Attachment 4761 Details for
Bug 17338
[FR] Перезагружать по <Enter> при обратном отсчете по окончании установки
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
'press any key to reboot' at the end of install patch (untested)
install2-init.c-presskey.diff (text/plain), 1.59 KB, created by
Michael Shigorin
on 2011-01-16 21:37:07 MSK
(
hide
)
Description:
'press any key to reboot' at the end of install patch (untested)
Filename:
MIME Type:
Creator:
Michael Shigorin
Created:
2011-01-16 21:37:07 MSK
Size:
1.59 KB
patch
obsolete
>--- install2-init.c 2009-10-17 11:05:18.789121846 +0300 >+++ _ 2011-01-16 20:30:00.359106091 +0200 >@@ -8,6 +8,7 @@ > #include <time.h> > #include <fcntl.h> > #include <mntent.h> >+ #include <termios.h> > > #include <sys/reboot.h> > #include <sys/mount.h> >@@ -130,12 +131,49 @@ > break; > } > >+ int >+ linux_kbhit(void) >+ { >+ struct termios oldstuff; >+ struct termios newstuff; >+ struct timeval tv = {0,1}; /* set one microsecond timeout */ >+ fd_set rdfds; >+ int fd = fileno(stdin); /* is usually zero */ >+ int retval; >+ >+ FD_ZERO(&rdfds); >+ FD_SET(fd, &rdfds); >+ >+ tcgetattr(fd, &oldstuff); >+ newstuff = oldstuff; /* save old attributes */ >+ >+ newstuff.c_lflag &= ~(ICANON | ECHO | IGNBRK); >+ >+ tcsetattr(fd, TCSANOW, &newstuff); /* set new attributes */ >+ >+ if (select(fd + 1, &rdfds, NULL, NULL, &tv) == -1) { >+ perror("select"); >+ exit(1); >+ } >+ if (FD_ISSET(fd, &rdfds)) { >+ retval = 1; >+ } >+ else { >+ retval = 0; >+ } >+ >+ tcsetattr(fd, TCSANOW, &oldstuff); /* restore old attributes */ >+ >+ return retval; >+ } >+ > static void > countdown(void) > { > int i; > > fprintf(stderr, "%s", "\nYou may safely reboot your system\n"); >+ fprintf(stderr, "%s", "Press any key to reboot\n"); > fflush(stderr); > > /* Set countdown when METHOD = cdrom */ >@@ -143,6 +181,9 @@ > { > for (i = REBOOT_TIMEOUT; i > 0; --i) > { >+ if (linux_kbhit()) >+ break; >+ > fprintf(stderr, > "\rAutomatic reboot after %d seconds... ", i); > fflush(stderr); >@@ -153,6 +194,8 @@ > fflush(stderr); > } > >+ >+ > static void > killall(void) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 17338
:
4559
| 4761