/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugbasedclient.c

  • Committer: Teddy Hogeborn
  • Date: 2008-08-01 07:04:32 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080801070432-5t1q0ds0bjxojyoz
* plugins.d/plugbasedclient.c (main): Close the pipe fd after dup2:ing
                                      it onto stdout.

Show diffs side-by-side

added added

removed removed

Lines of Context:
328
328
    int pipefd[2]; 
329
329
    ret = pipe(pipefd);
330
330
    if (ret == -1){
331
 
      perror(argv[0]);
 
331
      perror("pipe");
332
332
      goto end;
333
333
    }
334
334
    plugin *p = getplugin(dirst->d_name, &plugin_list);
345
345
      closedir(dir);
346
346
      close(pipefd[0]); /* close unused read end of pipe */
347
347
      dup2(pipefd[1], STDOUT_FILENO); /* replace our stdout */
 
348
      if(pipefd[1] > 2){
 
349
        close(pipefd[1]);
 
350
      }
348
351
      
349
352
      if(execv(filename, p->argv) < 0){
350
353
        perror(argv[0]);