1
0
mirror of https://github.com/golang/go synced 2024-11-21 23:24:41 -07:00

gopack: make unused page function a fatal error

R=iant, rsc
CC=golang-dev
https://golang.org/cl/4601051
This commit is contained in:
Dave Cheney 2011-06-09 22:41:19 -04:00 committed by Russ Cox
parent 5e8b9c614b
commit 86183e43c9

View File

@ -1532,24 +1532,7 @@ arwrite(int fd, Armember *bp)
int int
page(Arfile *ap) page(Arfile *ap)
{ {
Armember *bp; sysfatal("page");
bp = ap->head;
if (!ap->paged) { /* not yet paged - create file */
ap->fd = mkstemp(ap->fname);
if (ap->fd < 0) {
fprint(2,"gopack: can't create temp file\n");
return 0;
}
ap->paged = 1;
}
if (!arwrite(ap->fd, bp)) /* write member and free buffer block */
return 0;
ap->head = bp->next;
if (ap->tail == bp)
ap->tail = bp->next;
free(bp->member);
free(bp);
return 1; return 1;
} }