Changes in / [7c539a8:0a9ffc5]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r4d9e311c r8135737  
    1212#include <sys/stat.h>
    1313#include <locale.h>
    14 #include <unistd.h>
    1514
    1615#if OWL_STDERR_REDIR
     
    428427  if (0 != pipe(pipefds)) {
    429428    perror("pipe");
    430     owl_function_debugmsg("stderr_replace: pipe FAILED");
     429    owl_function_debugmsg("stderr_replace: pipe FAILED\n");
    431430    return -1;
    432431  }
    433     owl_function_debugmsg("stderr_replace: pipe: %d,%d", pipefds[0], pipefds[1]);
    434   if (-1 == dup2(pipefds[1], STDERR_FILENO)) {
    435     owl_function_debugmsg("stderr_replace: dup2 FAILED (%s)", strerror(errno));
     432    owl_function_debugmsg("stderr_replace: pipe: %d,%d\n", pipefds[0], pipefds[1]);
     433  if (-1 == dup2(pipefds[1], 2 /*stderr*/)) {
     434    owl_function_debugmsg("stderr_replace: dup2 FAILED (%s)\n", strerror(errno));
    436435    perror("dup2");
    437436    return -1;
     
    515514#if OWL_STDERR_REDIR
    516515  /* Do this only after we've started curses up... */
    517   if (isatty(STDERR_FILENO)) {
    518     owl_function_debugmsg("startup: doing stderr redirection");
    519     channel = g_io_channel_unix_new(stderr_replace());
    520     g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR, &stderr_redirect_handler, NULL);
    521     g_io_channel_unref(channel);
    522   }
     516  owl_function_debugmsg("startup: doing stderr redirection");
     517  channel = g_io_channel_unix_new(stderr_replace());
     518  g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR, &stderr_redirect_handler, NULL);
     519  g_io_channel_unref(channel);
    523520#endif
    524521
Note: See TracChangeset for help on using the changeset viewer.