libpurple/plugins/perl/perl.c

changeset 23917
8555374207d8
parent 23915
b62601fd6e7d
child 23930
c1c3d7cab338
equal deleted inserted replaced
23916:76b2c63d074c 23917:8555374207d8
265 PERL_SET_CONTEXT(prober); 265 PERL_SET_CONTEXT(prober);
266 266
267 PL_perl_destruct_level = 1; 267 PL_perl_destruct_level = 1;
268 perl_construct(prober); 268 perl_construct(prober);
269 269
270 /* Fix IO redirection to match where pidgin's is going.
271 * Without this, we lose stdout/stderr unless we redirect to a file */
272 #ifdef _WIN32
273 {
274 PerlIO* newprlIO = PerlIO_open("CONOUT$", "w");
275 if (newprlIO) {
276 int stdout_fd = PerlIO_fileno(PerlIO_stdout());
277 int stderr_fd = PerlIO_fileno(PerlIO_stderr());
278 PerlIO_close(PerlIO_stdout());
279 PerlIO_close(PerlIO_stderr());
280 PerlLIO_dup2(PerlIO_fileno(newprlIO), stdout_fd);
281 PerlLIO_dup2(PerlIO_fileno(newprlIO), stderr_fd);
282
283 PerlIO_close(newprlIO);
284 }
285 }
286 #endif
287
270 perl_parse(prober, xs_init, argc, argv, NULL); 288 perl_parse(prober, xs_init, argc, argv, NULL);
271 289
272 perl_run(prober); 290 perl_run(prober);
273 291
274 plugin_info = perl_get_hv("PLUGIN_INFO", FALSE); 292 plugin_info = perl_get_hv("PLUGIN_INFO", FALSE);

mercurial