All pastes #777236 Raw Edit

Miscellany

public c v1 · immutable
·published 2007-11-16 17:22 UTC
rendered paste body
int check_read(int sock, char *name){    char *buf;    fprintf(stderr,"sock er %d \n", sock);    ssize_t n = read(sock, buf, 4);    if (n == -1)        perror("check_read: ");    if( (strcmp(buf,"HAI")) != 0){        exit(1);        //This should hopefully never happen    }    n = write(sock, "SUP", 4);    if (n == -1)        perror("write: ");/*  printf("We are ready for incomming connections \n"); DEBUG      */    return 1;}