rem: if ((chmod(fifo, fifo_mode)<0)) {
add: if ((chmod(fifo, sock_mode)<0)) {
context: int init_fifo_server(){	char *t;	struct stat filestat;	int n;	long opt;	if (fifo==NULL) {		DBG("DBG: open_fifo_server: no fifo will be opened\n");		/* everything is ok, we just do not want to start */		return 1;	}	if (strlen(fifo)==0) {		DBG("DBG: open_fifo_server: fifo disabled\n");		return 1;	}	DBG("DBG: open_uac_fifo: opening fifo...\n");	n=stat(fifo, &filestat);	if (n==0){		/* FIFO exist, delete it (safer) */		if (unlink(fifo)<0){			LOG(L_ERR, "ERROR: open_fifo_server: cannot delete old fifo (%s):"					" %s\n", fifo, strerror(errno));			return -1;		}	}else if (n<0 && errno!=ENOENT){		LOG(L_DBG, "DEBUG: open_fifo_server: FIFO stat failed: %s\n",			strerror(errno));	}		/* create FIFO ... */		if ((mkfifo(fifo, fifo_mode)<0)) {			LOG(L_ERR, "ERROR: open_fifo_server; can't create FIFO: "					"%s (mode=%d)\n",					strerror(errno), fifo_mode);			return -1;		} 		DBG("DEBUG: FIFO created @ %s\n", fifo );		if ((chmod(fifo, fifo_mode)<0)) {			LOG(L_ERR, "ERROR: open_fifo_server; can't chmod FIFO: "					"%s (mode=%d)\n",					strerror(errno), fifo_mode);			return -1;		}	DBG("DEBUG: fifo %s opened, mode=%d\n", fifo, fifo_mode );	time(&up_since);	t=ctime(&up_since);	if (strlen(t)+1>=MAX_CTIME_LEN) {		LOG(L_ERR, "ERROR: open_fifo_server: "			"too long date %d\n", (int)strlen(t));		return -1;	}	memcpy(up_since_ctime,t,strlen(t)+1);	/* open it non-blocking or else wait here until someone	 * opens it for writting */	fifo_read=open(fifo, O_RDONLY|O_NONBLOCK, 0);	if (fifo_read<0) {		LOG(L_ERR, "ERROR: init_fifo_server: fifo_read did not open: %s\n",			strerror(errno));		return -1;	}	fifo_stream=fdopen(fifo_read, "r");	if (fifo_stream==NULL) {		LOG(L_ERR, "ERROR: init_fifo_server: fdopen failed: %s\n",			strerror(errno));		return -1;	}	/* make sure the read fifo will not close */	fifo_write=open(fifo, O_WRONLY|O_NONBLOCK, 0);	if (fifo_write<0) {		LOG(L_ERR, "ERROR: init_fifo_server: fifo_write did not open: %s\n",			strerror(errno));		return -1;	}	/* set read fifo blocking mode */	if ((opt=fcntl(fifo_read, F_GETFL))==-1){		LOG(L_ERR, "ERROR: init_fifo_server: fcntl(F_GETFL) failed: %s [%d]\n",				strerror(errno), errno);		return -1;	}	if (fcntl(fifo_read, F_SETFL, opt & (~O_NONBLOCK))==-1){		LOG(L_ERR, "ERROR: init_fifo_server: fcntl(F_SETFL) failed: %s [%d]\n",				strerror(errno), errno);		return -1;	}	return 0;}