add: for (i=0; i<cnt; i++ ) { DBG("vm param %d : len=%d <%.*s>\n",i,lines[i].len, lines[i].len,lines[i].s); }
context: static int write_to_vm_fifo(char *fifo, str *lines, int cnt ){	int   fd_fifo;#if 0	char *buf, *p;	int len;	int i;#endif#if 0	/* contruct buffer first */	len=0;	for (i=0; i<cnt; i++) {	    if (!lines[i].s)		lines[i]=empty_param;	    len+=lines[i].len+1;	}	buf=pkg_malloc(len+1);	if (!buf) {		LOG(L_ERR, "ERROR: write_to_vm_fifo: no mem (size=%i)\n",len+1);		return -1;	}	p=buf;	for (i=0; i<cnt; i++ ) {		memcpy(p, lines[i].s, lines[i].len);		p+=lines[i].len;		*p='\n';		p++;	}#endif	/* open FIFO file stream */	if((fd_fifo = open(fifo,O_WRONLY | O_NONBLOCK)) == -1){		switch(errno){			case ENXIO:				LOG(L_ERR,"ERROR: %s: ans_machine deamon is not running !\n",								exports.name);			default:				LOG(L_ERR,"ERROR: %s: %s\n",exports.name,strerror(errno));		}		goto error;	}	/* write now (unbuffered straight-down write) */#if 0	DBG("vm: write_to_vm_fifo: <%.*s>\n",len,buf);	if (write(fd_fifo, buf,len)==-1) {		LOG(L_ERR, "ERROR: write_to_vm_fifo: write failed: %s\n",					strerror(errno));	}#elserepeat:	if (writev(fd_fifo, (struct iovec*)lines, cnt)<0) {		if (errno!=EINTR) {			LOG(L_ERR, "ERROR: write_to_vm_fifo: writev failed: %s\n",				strerror(errno));			close(fd_fifo);			goto error;		} else {			goto repeat;		}	}#endif	close(fd_fifo);	DBG("DEBUG: write_to_vm_fifo: write completed\n");#if 0	pkg_free(buf);#endif	return 1; /* OK */error:#if 0	pkg_free(buf);#endif	return -1;}