Changeset 79dbcef for lib


Ignore:
Timestamp:
11/24/05 14:28:08 (16 years ago)
Author:
Daniel Lawson <dlawson@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
85418c7
Parents:
9cecdb2
Message:

wrapped stdin and stdout in fileno() when passing to LIBTRACE_FDOPEN

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r9cecdb2 r79dbcef  
    269269                // STDIN
    270270                libtrace->sourcetype = STDIN;
    271                 if ((INPUT.file = LIBTRACE_FDOPEN(stdin, "r")) < 0) {
     271                if ((INPUT.file = LIBTRACE_FDOPEN(fileno(stdin), "r")) < 0) {
    272272                        perror("libtrace_fdopen:");
    273273                        return 0;
     
    382382        if (!strncmp(libtrace->uridata,"-",1)) {
    383383                // STDOUT
    384                 OUTPUT.file = LIBTRACE_FDOPEN(stdout,filemode);
     384                OUTPUT.file = LIBTRACE_FDOPEN(fileno(stdout),filemode);
    385385        }
    386386        else {
  • lib/format_wag.c

    rf66a4933 r79dbcef  
    3030
    3131#define _GNU_SOURCE
     32#include "config.h"
     33#include "common.h"
    3234#include "libtrace.h"
    3335#include "libtrace_int.h"
    3436#include "format_helper.h"
    3537#include "wag.h"
    36 #include "config.h"
    3738
    3839#ifdef HAVE_INTTYPES_H
     
    6364#include <stdlib.h>
    6465
    65 /*
    66 #if HAVE_ZLIB
    67 #  include <zlib.h>
    68 #  define LIBTRACE_READ gzread
    69 #  define LIBTRACE_FDOPEN gzdopen
    70 #  define LIBTRACE_CLOSE gzclose
    71 #  define LIBTRACE_WRITE gzwrite
    72 #else
    73 #  define LIBTRACE_READ read
    74 #  define LIBTRACE_FDOPEN open
    75 #  define LIBTRACE_CLOSE close
    76 #  define LIBTRACE_WRITE write
    77 #endif
    78 */
    7966#ifdef HAVE_LIMITS_H
    8067#  include <limits.h>
     
    146133                // STDIN
    147134                libtrace->sourcetype = STDIN;
    148                 INPUT.file = LIBTRACE_FDOPEN(STDIN,"r");
     135                INPUT.file = LIBTRACE_FDOPEN(fileno(stdin),"r");
    149136
    150137        } else {
Note: See TracChangeset for help on using the changeset viewer.