SDL experiment, program hangs in ioctl(keyboard_fd, VT_WAITACTIVE, current_vt);

mobi phil mobi at mobiphil.com
Mon Apr 19 00:36:44 CEST 2010


Hello,


anybody can help with this? I think that there is a bug with our keyboard
driver...

any sdl application hang in the following call, if started second time...

I reproduced in a simplified the "bad behaving code":



int main()
{

   int t = -1;

   int tty0_fd = open("/dev/tty0", O_WRONLY, 0);
   if( tty0_fd < 0)
   {
      printf("cannot open /dev/tty0\n");
      return -1;
   }
   else
   {
      ioctl(tty0_fd, VT_OPENQRY, &t);

      printf("new t: %d\n", t);

   }
   static const char * const vcs =  "/dev/tty%d";

   char vtpath[12];
   sprintf(vtpath, vcs, t);

   int keyboard_fd = open(vtpath, O_RDWR, 0);
   if(keyboard_fd < 0)
   {

      printf("cannot open %s\n", vtpath);
      return -2;
   }

   printf("kbfd: %d\n", keyboard_fd);

   if ( ioctl(keyboard_fd, VT_ACTIVATE, t) == 0 ) {
      ioctl(keyboard_fd, VT_WAITACTIVE, t);

      //this never exits......

   }


}




-- 
rgrds,
mobi phil

being mobile, but including technology
http://mobiphil.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20100419/75578aff/attachment.htm 


More information about the openmoko-kernel mailing list