Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

MINIX

Name: Anonymous 2011-01-22 13:55

That is all.

Name: Anonymous 2011-01-24 9:24

>>8

Fixed in SVN


static int copy_data(int srcfd, int dstfd)
{
    char buf[8192];
    ssize_t n;
    int total=0;

    /** FIXME: handle error from read() */

    /* Copy the little bytes themselves. (Source from cp.c). */
    while ((n= read(srcfd, buf, sizeof(buf))) > 0) {
    char *bp = buf;
    ssize_t r = 0;

        /** FIXME: handle error from write() */
    while (n > 0 && (r= write(dstfd, bp, n)) > 0) {
        bp += r;
        n -= r;
        total += r;
    }
    if (r == 0) {
            fprintf(stderr, "Warning: EOF writing to output file.\n");
            return(-1);
    }
    }
    return(total);
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List