+ for(y=0;y<bmp->height;y++) {
+ if(write(bmp->fd,bmp->map+y*bmp->width,xsize)<xsize) {
+ dprintf(bmp->outfd,"[bmp] unable to write image data line %d\n",y);
+ return B_E_WRITE_DATA;
+ }
+ if(write(bmp->fd,buf,fill)<fill) {
+ dprintf(bmp->outfd,"[bmp] unable to write fill bytes\n");
+ return B_E_WRITE_DATA;
+ }
+ }
+
+ close(bmp->fd);