cmd_argv[i] = NULL;
}
- /* clear all resources */
- for (i = 0; i < NUM_RESOURCES;)
- rs[i++] = NULL;
-
rs[Rs_name] = rxvt_r_basename (argv[0]);
/*
if (!display
&& ! (display = displays.get (rs[Rs_display_name])))
- {
- rxvt_print_error ("can't open display %s", rs[Rs_display_name]);
- exit (EXIT_FAILURE);
- }
+ rxvt_fatal ("can't open display %s", rs[Rs_display_name]);
extract_resources (display->display, rs[Rs_name]);
SET_LOCALE (this->locale);
mbstate.reset ();
#endif
+#if 0
#if HAVE_NL_LANGINFO
free (codeset);
codeset = strdup (nl_langinfo (CODESET));
#else
enc_utf8 = 1;
#endif
+#endif
}
void
{
#ifdef USE_XIM
if (!locale)
- rxvt_print_error ("Setting locale failed.");
+ rxvt_warn ("setting locale failed, working without locale support.\n");
else
{
Atom wmlocale;
if (!XSupportsLocale ())
{
- rxvt_print_error ("The locale is not supported by Xlib");
+ rxvt_warn ("the locale is not supported by Xlib, working withotu locale support.\n");
return;
}
#endif
if ((cmd_fd = run_command (argv)) < 0)
- {
- rxvt_print_error ("aborting");
- exit (EXIT_FAILURE);
- }
+ rxvt_fatal ("failure while running command, aborting");
}
/*----------------------------------------------------------------------*/
case Color_fg:
case Color_bg:
/* fatal: need bg/fg color */
- rxvt_print_error ("aborting");
- exit (EXIT_FAILURE);
+ rxvt_fatal ("unable to get foreground/background colour, aborting");
/* NOTREACHED */
break;
#ifndef NO_CURSORCOLOR
gcvalue.background = PixColors[Color_bg];
gcvalue.graphics_exposures = 1;
TermWin.gc = XCreateGC (display->display, TermWin.vt,
- GCForeground | GCBackground
- | GCGraphicsExposures, &gcvalue);
+ GCForeground | GCBackground | GCGraphicsExposures,
+ &gcvalue);
TermWin.drawable = new rxvt_drawable (display, TermWin.vt);
/* get master (pty) */
if ((cfd = rxvt_get_pty (& (tty_fd), & (ttydev))) < 0)
- {
- rxvt_print_error ("can't open pseudo-tty");
- return -1;
- }
+ rxvt_fatal ("can't open pseudo-tty");
fcntl (cfd, F_SETFL, O_NONBLOCK);
if ((tty_fd = rxvt_get_tty (ttydev)) < 0)
{
close (cfd);
- rxvt_print_error ("can't open slave tty %s", ttydev);
- return -1;
+ rxvt_fatal ("can't open slave tty %s", ttydev);
}
}
#ifndef NO_BACKSPACE_KEY
switch (cmd_pid = fork ())
{
case -1:
- rxvt_print_error ("can't fork");
- return -1;
+ rxvt_fatal ("can't fork");
case 0:
close (cfd); /* only keep tty_fd and STDERR open */
init_env ();
if (rxvt_control_tty (tty_fd, ttydev) < 0)
- rxvt_print_error ("could not obtain control of tty");
+ fprintf (stderr, "%s: could not obtain control of tty.", RESNAME);
else
{
/* Reopen stdin, stdout and stderr over the tty file descriptor */
close (tty_fd);
run_child (argv);
+ fprintf (stderr, "%s: unable to exec child.", RESNAME);
}
- exit (EXIT_FAILURE);
- /* NOTREACHED */
+
+ _exit (EXIT_FAILURE);
+
default:
{
#if defined(HAVE_STRUCT_UTMP) && defined(HAVE_TTYSLOT)
dup2 (fdstdin, STDIN_FILENO);
close (fdstdin);
#endif
-
}
+
close (tty_fd); /* keep STDERR_FILENO, cmd_fd, display->fd () open */
break;
}