/[man-db]/man-db/lib/pipeline.c
ViewVC logotype

Diff of /man-db/lib/pipeline.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by cjwatson, Sun Aug 3 22:53:19 2003 UTC revision 1.9 by cjwatson, Sun Aug 3 23:00:23 2003 UTC
# Line 428  void pipeline_start (pipeline *p) Line 428  void pipeline_start (pipeline *p)
428    
429                          /* input, reading side */                          /* input, reading side */
430                          if (last_input != -1) {                          if (last_input != -1) {
431                                  if (close (0) < 0)                                  if (dup2 (last_input, 0) < 0)
432                                          error (FATAL, errno,                                          error (FATAL, errno, _("dup2 failed"));
                                                _("close failed"));  
                                 if (dup (last_input) < 0)  
                                         error (FATAL, errno, _("dup failed"));  
433                                  if (close (last_input) < 0)                                  if (close (last_input) < 0)
434                                          error (FATAL, errno,                                          error (FATAL, errno,
435                                                 _("close failed"));                                                 _("close failed"));
# Line 440  void pipeline_start (pipeline *p) Line 437  void pipeline_start (pipeline *p)
437    
438                          /* output, writing side */                          /* output, writing side */
439                          if (output_write != -1) {                          if (output_write != -1) {
440                                  if (close (1) < 0)                                  if (dup2 (output_write, 1) < 0)
441                                          error (FATAL, errno,                                          error (FATAL, errno, _("dup2 failed"));
                                                _("close failed"));  
                                 if (dup (output_write) < 0)  
                                         error (FATAL, errno, _("dup failed"));  
442                                  if (close (output_write) < 0)                                  if (close (output_write) < 0)
443                                          error (FATAL, errno,                                          error (FATAL, errno,
444                                                 _("close failed"));                                                 _("close failed"));

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26