I don't know the reason but negative values don't work here. We simply use
big integers now to avoid clashes with valid getopt() values.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
A symbol table should never be created twice therefore we can make it
static and global. We add locks so it is totally thread-safe, too.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We use a single version number. The current state seems to be pretty
stable and has all the important features regarding the DRM/input setup.
Only missing stuff is VTE and console.
This is no stable release but rather a first development release.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now use the new input/video hooks to avoid waking up the UI all the
time. This reduces the code in the generic UI subsystem and makes the
terminal handle all the stuff.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Allow to send arbitrary signals to the foreground process group of the
pty. Linux supports the TIOCSIG ioctl so we actually do not need to
implement this on our own, yeah!
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We shouldn't call the close-cb twice. Therefore, correctly free the FD on
first error, however, keep the signal-callback to get nice log-messages.
Only when the user calls *_close() we eventually stop everything.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We currently return "ret" when child setup fails, however, we should
rather call exit(). Also avoid cleaning up as this is impossible here
anyway.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We should do fork() as the last operation when starting the child.
Currently, if our eloop-add() fails, we have a started child but return
failure to the caller. Therefore, the child will stay alive but we do not
use it.
We now perform all startup correctly before fork()'ing so we are always
safe when starting the child.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
pthread is already in our vmem due to our dependencies so link to it
explicitly and use pthread_sigmask to avoid buggy sigprocmask in
multi-threaded applications.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Our current signal source has the problem that a single signal event is
only delivered to one random registered source. This is the design of the
signalfd kernel feature. However, for signals like SIGCHLD it is often
desired to have multiple callbacks. Hence, while keeping the old
signal-source, we now also allow a shared signal source. It is registered
the same way as the old signal source but uses a shared hook.
We may remove the old source so we don't use it in the new implementation.
There are still problems when multiple eloops are used in a single
process and you register the same shared-signum in both eloops. However,
such a design is bad anyway, so we don't care.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When deleting a hook we should not search for the callback only. Otherwise
we might remove the wrong callback. Therefore, we now search for callback
and data argument. If multiple callbacks are registered with the same data
and cb, then we don't care which one is removed as this wouldn't make any
difference. They behave the same way, anyway.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
epoll_wait() returns EINTR even if using SA_RESTART for signals.
Therefore, catch EINTR and set count to zero.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We assigned stack-storage to a global pointer and therefore we got
seg-faults when using the default. Fix that.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Allow to specify a separate login-program that is executed instead of the
default. All arguments specified after --login are considered argv[] of
the new process and not parsed by the library.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Set CRTC state correctly after waking up. Otherwise the displays will keep
their previous state until the next redraw.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Use the new UI subsystem in the main application. The kmscon application
provides now the same functionality as the test_terminal application.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The hook structure can be used to provide a central hook where other
subsystems can register callbacks.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We cannot check for dev->fd as the fd is only set when the input device
has keys. Therefore check for rfd now.
Also remove the NULL check in *_sleep() as it is not needed. All public
APIs allow passing NULL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Remove newline from log-messages and set LOG_SUBSYSTEM to "input". Also
fix some small indentation issues.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Suppress debug, info, notice and warning messages if --silent is given.
This is overwritten by --debug and --verbose.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is not finished and only implements the basic VT handling +
application initialization.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
eloop.c and log.c use struct timeval to calculate time-diffs but
incorrectly use "-" instead of "+" as the value is already negative.
They also use unsigned integers so fix both occurences.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>