~ubuntu-branches/ubuntu/quantal/usplash/quantal

« back to all changes in this revision

Viewing changes to bogl/bogl.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2009-10-15 23:18:30 UTC
  • Revision ID: james.westby@ubuntu.com-20091015231830-yp4s7hcwdg33jz9d
Tags: 0.5.45
* Make sure that when we open devices we use O_NOCTTY, since otherwise
  when run under Upstart we end up with controlling terminals that we
  didn't expect.
* Then after we've forked into a child process, we call the TIOCSCTTY
  ioctl() to take control of the terminal we're on so we get input.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
  assert (status < 2);
118
118
  visible = 1;
119
119
  
120
 
  fb = open ("/dev/fb0", O_RDWR);
 
120
  fb = open ("/dev/fb0", O_RDWR | O_NOCTTY);
121
121
  if (fb < 0)
122
 
    fb = open ("/dev/fb/0", O_RDWR);
 
122
    fb = open ("/dev/fb/0", O_RDWR | O_NOCTTY);
123
123
  if (fb < 0) {
124
124
          return bogl_fail ("opening /dev/fb0: %s", strerror (errno));
125
125
  }
126
126
 
127
 
  tty = open ("/dev/tty0", O_RDWR);
 
127
  tty = open ("/dev/tty0", O_RDWR | O_NOCTTY);
128
128
  if (tty < 0)
129
 
    tty = open ("/dev/vc/0", O_RDWR);
 
129
    tty = open ("/dev/vc/0", O_RDWR | O_NOCTTY);
130
130
  if (tty < 0) {
131
131
          return bogl_fail ("opening /dev/tty0: %s", strerror (errno));
132
132
  }