Annotation of fwmaker/src/image.c, revision 1.1

1.1     ! misho       1: #include "global.h"
        !             2: #include "image.h"
        !             3: 
        !             4: 
        !             5: int
        !             6: imageOpen(int flags)
        !             7: {
        !             8:        ETRACE();
        !             9: 
        !            10:        imgfd = open(image, O_RDWR | flags, 0644);
        !            11:        if (imgfd == -1) {
        !            12:                ESYSERR(0);
        !            13:                return -1;
        !            14:        } else
        !            15:                imgsiz = lseek(imgfd, 0, SEEK_END);
        !            16: 
        !            17:        EVERBOSE(1, "Image open #%d", imgfd);
        !            18:        return imgfd;
        !            19: }
        !            20: 
        !            21: void
        !            22: imageClose()
        !            23: {
        !            24:        ETRACE();
        !            25: 
        !            26:        if (imgfd > 2) {
        !            27:                EVERBOSE(1, "Image close #%d", imgfd);
        !            28:                close(imgfd);
        !            29:                imgfd ^= imgfd;
        !            30:                imgsiz ^= imgsiz;
        !            31:        }
        !            32: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>