XWindowAttributes wattr;
int depth, width, height;
- if ((s = malloc(sizeof(screen_t))) == NULL) {
- /* XXX Good error reporting */
- goto err;
- }
+ if ((s = malloc(sizeof(screen_t))) == NULL)
+ err(EXIT_FAILURE, "malloc()");
screen = s;
- atexit(screen_cleanup);
s->shm = false;
- s->dpy = XOpenDisplay(NULL);
+ if ((s->dpy = XOpenDisplay(NULL)) == NULL)
+ err(EXIT_FAILURE, "XOpenDisplay()");
+ atexit(screen_cleanup);
if (!XMatchVisualInfo(s->dpy, XDefaultScreen(s->dpy), 24, TrueColor,
&s->vinfo))
{
tty_t *s;
- sighandler_setup();
-
if ((s = malloc(sizeof(tty_t))) == NULL)
err(EXIT_FAILURE, "tty_shell() - malloc()");
ttys = s;
s->winsize = *winsize;
s->command = command;
+ sighandler_setup();
+
if ((s->shell_pid = child_launch(envp)) == -1)
err(EXIT_FAILURE, "tty_shell() - child_launch()");