Changes in / [7c539a8:0a9ffc5]
Legend:
- Unmodified
- Added
- Removed
-
owl.c
r4d9e311c r8135737 12 12 #include <sys/stat.h> 13 13 #include <locale.h> 14 #include <unistd.h>15 14 16 15 #if OWL_STDERR_REDIR … … 428 427 if (0 != pipe(pipefds)) { 429 428 perror("pipe"); 430 owl_function_debugmsg("stderr_replace: pipe FAILED ");429 owl_function_debugmsg("stderr_replace: pipe FAILED\n"); 431 430 return -1; 432 431 } 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)); 436 435 perror("dup2"); 437 436 return -1; … … 515 514 #if OWL_STDERR_REDIR 516 515 /* 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); 523 520 #endif 524 521
Note: See TracChangeset
for help on using the changeset viewer.