File:  [ELWIX - Embedded LightWeight unIX -] / fwmaker / src / image.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jan 4 18:08:18 2026 UTC (13 days, 12 hours ago) by misho
Branches: misho
CVS tags: fwmaker
fwmaker embedded image maker

#include "global.h"
#include "image.h"


int
imageOpen(int flags)
{
	ETRACE();

	imgfd = open(image, O_RDWR | flags, 0644);
	if (imgfd == -1) {
		ESYSERR(0);
		return -1;
	} else
		imgsiz = lseek(imgfd, 0, SEEK_END);

	EVERBOSE(1, "Image open #%d", imgfd);
	return imgfd;
}

void
imageClose()
{
	ETRACE();

	if (imgfd > 2) {
		EVERBOSE(1, "Image close #%d", imgfd);
		close(imgfd);
		imgfd ^= imgfd;
		imgsiz ^= imgsiz;
	}
}

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