This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

about fdopen


Hi,part of my program is :
    static FILE *sfp;
    if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
        printf("error to creat a socket\n");
        exit(1);
    }
    if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
        printf("error to connect\n");
        exit(1);
    }
    if ((sfp = fdopen(s, "w")) == 0) {
        printf("error to fdopen s\n");
        exit(1);
    }
 
    socket() and connect() are right,but fdopen() can't return,who can tell me why?
    Thanks a lot!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]