Changeset 4d9e311c
- Timestamp:
- Aug 12, 2012, 9:11:23 PM (12 years ago)
- Branches:
- master, release-1.10, release-1.9
- Children:
- ea0c453, 54d9b42, a8c55b5, 7c539a8
- Parents:
- 0a9ffc5
- git-author:
- David Benjamin <davidben@mit.edu> (08/12/12 18:08:20)
- git-committer:
- David Benjamin <davidben@mit.edu> (08/12/12 21:11:23)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
r8135737 r4d9e311c 12 12 #include <sys/stat.h> 13 13 #include <locale.h> 14 #include <unistd.h> 14 15 15 16 #if OWL_STDERR_REDIR … … 427 428 if (0 != pipe(pipefds)) { 428 429 perror("pipe"); 429 owl_function_debugmsg("stderr_replace: pipe FAILED \n");430 owl_function_debugmsg("stderr_replace: pipe FAILED"); 430 431 return -1; 431 432 } 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));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)); 435 436 perror("dup2"); 436 437 return -1; … … 514 515 #if OWL_STDERR_REDIR 515 516 /* Do this only after we've started curses up... */ 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); 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 } 520 523 #endif 521 524
Note: See TracChangeset
for help on using the changeset viewer.