Skip to content

Commit

Permalink
Put stdout/stderr into gossip logs for easier tgtd debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pete Wyckoff committed Feb 13, 2008
1 parent 8188e26 commit 5e3c66e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/server/pvfs2-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ struct server_configuration_s *PINT_get_server_config(void)
}

#ifdef PVFS_OSD_INTEGRATED
extern void *tgtd(char *arg);
extern void *tgtd(void *arg);
#endif

int main(int argc, char **argv)
Expand Down Expand Up @@ -738,6 +738,13 @@ static int server_initialize(
else if(!strcmp(server_config.logtype, "file"))
{
ret = gossip_enable_file(server_config.logfile, "a");
#ifdef PVFS_OSD_INTEGRATED
/* grab stdout, stderr from tgtd */
freopen(server_config.logfile, "a", stdout);
setlinebuf(stdout);
freopen(server_config.logfile, "a", stderr);
setlinebuf(stderr);
#endif
}
else
{
Expand Down

0 comments on commit 5e3c66e

Please sign in to comment.