ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/init.C
(Generate patch)

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.239 by ayin, Sat Jan 19 13:00:07 2008 UTC vs.
Revision 1.243 by root, Fri Jan 25 16:04:57 2008 UTC

10 * Copyright (c) 1996 Chuck Blake <cblake@BBN.COM> 10 * Copyright (c) 1996 Chuck Blake <cblake@BBN.COM>
11 * Copyright (c) 1997 mj olesen <olesen@me.queensu.ca> 11 * Copyright (c) 1997 mj olesen <olesen@me.queensu.ca>
12 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> 12 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de>
13 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> 13 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com>
14 * - extensive modifications 14 * - extensive modifications
15 * Copyright (c) 2003-2007 Marc Lehmann <pcg@goof.com> 15 * Copyright (c) 2003-2008 Marc Lehmann <pcg@goof.com>
16 * 16 *
17 * This program is free software; you can redistribute it and/or modify 17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by 18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or 19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version. 20 * (at your option) any later version.
310 set_option (Opt_pastableTabs); 310 set_option (Opt_pastableTabs);
311 set_option (Opt_intensityStyles); 311 set_option (Opt_intensityStyles);
312 set_option (Opt_iso14755_52); 312 set_option (Opt_iso14755_52);
313} 313}
314 314
315void 315static void
316rxvt_term::init_secondary () 316init_secondary ()
317{ 317{
318 int i; 318 int i;
319 319
320 /*
321 * Close all unused file descriptors
322 * We don't want them, we don't need them.
323 */
324 if ((i = open ("/dev/null", O_RDONLY)) < 0) 320 if ((i = open ("/dev/null", O_RDONLY)) < 0)
325 { 321 {
326 /* TODO: BOO HISS */
327 dup2 (STDERR_FILENO, STDIN_FILENO); 322 dup2 (STDERR_FILENO, STDIN_FILENO);
328 } 323 }
329 else if (i != STDIN_FILENO) 324 else if (i != STDIN_FILENO)
330 { 325 {
331 dup2 (i, STDIN_FILENO); 326 dup2 (i, STDIN_FILENO);
332 close (i); 327 close (i);
333 } 328 }
334 329
335 dup2 (STDERR_FILENO, STDOUT_FILENO); 330 dup2 (STDERR_FILENO, STDOUT_FILENO);
336
337#if 0 // schmorp sayz closing filies is murder
338 for (i = STDERR_FILENO + 1; i < num_fds; i++)
339 {
340#ifdef __sgi /* Alex Coventry says we need 4 & 7 too */
341 if (i == 4 || i == 7)
342 continue;
343#endif
344 close (i);
345 }
346#endif
347} 331}
348 332
349/*----------------------------------------------------------------------*/ 333/*----------------------------------------------------------------------*/
350const char ** 334const char **
351rxvt_term::init_resources (int argc, const char *const *argv) 335rxvt_term::init_resources (int argc, const char *const *argv)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines