+ if((bmp->fd=open(bmp->file,O_WRONLY)<0) {
+ dprintf(bmp->outfd,"[bmp] unable to open file %s\n",bmp->file);
+ return B_NO_FILE;
+ }
+
+ if(write(bmp->fd,&(bmp->hdr),BMP_H_SIZE)<BMP_H_SIZE) {
+ dprintf(bmp->outfd,"[bmp] unable to write bmp header\n");
+ return B_E_WRITE_DATA;
+ }
+
+ if(write(bmp->fd,&(bmp->info),BMP_I_SIZE)<BMP_I_SIZE) {
+ dprintf(bmp->outfd,"[bmp] unable to write bmp info\n");
+ return B_E_WRITE_DATA;
+ }