Logo Search packages:      
Sourcecode: fence-agents version File versions  Download package

void close_all_files ( void   )

Close all file descriptors in a child process.

Open fd's are inherited across exec unless they are marked close on exec, which must be done explicitly with fcntl(). While this should not affect the operation of telnet, it was found that in some cases it did. Its easier to just fix it this way than to fix telnet.

Definition at line 333 of file expect.c.

Referenced by StartProcess().

      register int i, fd_table_size;

      fd_table_size = getdtablesize ();
      if (fd_table_size > 256)/* clamp to a reasonable value */
            fd_table_size = 256;
      for (i = 3; i < fd_table_size; i++)
            close (i);

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index