您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ERROR_EXIT函数代码示例

51自学网 2021-06-01 20:33:22
  C++
这篇教程C++ ERROR_EXIT函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ERROR_EXIT函数的典型用法代码示例。如果您正苦于以下问题:C++ ERROR_EXIT函数的具体用法?C++ ERROR_EXIT怎么用?C++ ERROR_EXIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ERROR_EXIT函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main(){#if defined(USE_DBC)   psocMemoryFile  mem;   psocErrorHandler errorHandler;   bool ok;   psocMemoryFileStatus status;      /* The rename is a work around for a bug on Windows. It seems that the     * delete call (unlink) is not as synchroneous as it should be...    */   rename( "MemFile.mem", "MemFile.old" );   unlink( "MemFile.old" );   psocInitErrorDefs();   psocInitErrorHandler( &errorHandler );   psocInitMemoryFile( &mem, 10, "MemFile.mem" );   ok = psocCreateBackstore( &mem, 0644, &errorHandler );   if ( ok != true ) {      ERROR_EXIT( expectedToPass, &errorHandler, unlink( "MemFile.mem" ) );   }      mem.initialized = 0;   psocBackStoreStatus( &mem, &status );   ERROR_EXIT( expectedToPass, NULL, unlink( "MemFile.mem" ) );#else   return 1;#endif}
开发者ID:dprevost,项目名称:photon,代码行数:31,


示例2: DEBUG_PRINTF

PdaDebugReturnCodePciDevice_deleteDMABuffer(    PciDevice *device,    DMABuffer *buffer){    DEBUG_PRINTF(PDADEBUG_ENTER, "");    if(device == NULL)    { ERROR_EXIT( EINVAL, exit, "Invalid pointer!/n" ); }    if(buffer == NULL)    { ERROR_EXIT( EINVAL, exit, "Invalid pointer!/n" ); }    if(buffer == device->dma_buffer_list)    {        DMABuffer *head = NULL;        if(DMABuffer_getNext(buffer, &head) != PDA_SUCCESS)        { ERROR_EXIT( EINVAL, exit, "get_next failed!/n" ); }        device->dma_buffer_list = head;    }    RETURN(DMABuffer_free(buffer, PDA_DELETE));exit:    RETURN(EINVAL);}
开发者ID:cbm-fles,项目名称:pda,代码行数:29,


示例3: main

int main(){#if defined(USE_DBC)   psocMemoryFile  mem;   psocErrorHandler errorHandler;   bool ok;      /* The rename is a work around for a bug on Windows. It seems that the delete    * call is not as synchroneous as it should be...    */   rename( "MemFile.mem", "MemFile.old" );   unlink( "MemFile.old" );      psocInitErrorDefs();   psocInitErrorHandler( &errorHandler );   psocInitMemoryFile( &mem, 10, "MemFile.mem" );   ok = psocCreateBackstore( &mem, 0755, &errorHandler );   if ( ok != true ) {      ERROR_EXIT( expectedToPass, &errorHandler, unlink( "MemFile.mem" ) );   }      ok = psocOpenMemFile( &mem, NULL, &errorHandler );   unlink( "MemFile.mem" );      psocFiniMemoryFile( &mem );   psocFiniErrorHandler( &errorHandler );   psocFiniErrorDefs();   ERROR_EXIT( expectedToPass, NULL, unlink( "MemFile.mem" ) );#else   return 1;#endif}
开发者ID:dprevost,项目名称:photon,代码行数:35,


示例4: file_ReadFileEnd

/* Read a SW filemark, verify that it is a SW filemark, then skip to the next * HW filemark. If the read of the SW filemark shows it's an EOF, then * ignore that the SW filemark is not there and return 0 (found the SW filemark * missing with some 3.1 dumps). */static afs_int32file_ReadFileEnd(struct butm_tapeInfo *info){    afs_int32 code = 0;    afs_int32 blockType;    if (info->debug)	printf("butm: Read filemark end/n");    POLL();    info->error = 0;    code = check(info, READ_OP);    if (code)	ERROR_EXIT(code);    if (!READS || WRITES)	ERROR_EXIT(BUTM_BADOP);    info->status &= ~BUTM_STATUS_EOF;    code = ReadTapeBlock(info, tapeBlock, &blockType);    if (code)	ERROR_EXIT(code);    if ((blockType != BLOCK_FMEND) && (blockType != BLOCK_EOF))	ERROR_EXIT(BUTM_BADBLOCK);  error_exit:    return code;}
开发者ID:bagdxk,项目名称:openafs,代码行数:35,


示例5: CALLOC

/* -------------------------------------------------------- */BOT* ircBOT_new	(const char *nick, const char *pwd) {    /* -------------------------------------------------------- */    int x = 0;    BOT *bot 	= (BOT*) CALLOC(1, sizeof(BOT));    if(bot) {        if(!nick)            ERROR_EXIT("ircBOT_new: Error no NICK!!!/n");        bot->nick 			= strdup(nick);        if(pwd)            bot->pwd 		= strdup(pwd);        else            bot->pwd 		= NULL;        bot->srv.state 		= IRC_SYS_NEEDCONNECT;        bot->srv.sendbuf	= NULL;        bot->cmd_handler 	= LIST_new();        bot->tee_handler 	= LIST_new();        for(x=0; x<MAX_TIMER; x++)            bot->timer[x].id = -1;    }    /* add this bot to the global ones */    if(!all_bots)        all_bots = LIST_new();    if(!LIST_add(all_bots, bot))        ERROR_EXIT("ircBOT_new: Error adding bot to global BOT-List!!/n");    DEBUG("BOT with nick '%s' created./n", bot->nick);    return bot;};
开发者ID:BackupTheBerlios,项目名称:ircbot,代码行数:28,


示例6: file_WriteEODump

/* * Write the end-of-dump marker. */static afs_int32file_WriteEODump(struct butm_tapeInfo *info){    afs_int32 code = 0;    if (info->debug)	printf("butm: Write filemark EOD/n");    POLL();    info->error = 0;    code = check(info, WRITE_OP);    if (code)	ERROR_EXIT(code);    if (READS || WRITES)	ERROR_EXIT(BUTM_BADOP);    code = WriteTapeBlock(info, tapeBlock, BUTM_BLOCKSIZE, BLOCK_EOD);    if (code)	ERROR_EXIT(code);    info->status |= BUTM_STATUS_EOD;  error_exit:    return (code);}
开发者ID:bagdxk,项目名称:openafs,代码行数:29,


示例7: main

int main(){	pid_t pid;	int fd;	char buff[BUFF_SIZE];	if (-1 == (fd = open("/tmp/ipc", O_CREAT | O_RDWR, 0777)))		ERROR_EXIT("pipe");	pid = fork();	if (0 == pid) { /* child */			memset(buff, 0, BUFF_SIZE);		if (0 >= read(fd, buff, BUFF_SIZE))			ERROR_EXIT("read");		printf("read: %s/n", buff);	}else if (0 < pid) {	/* father */		sleep(1);		strcpy(buff, "helloworld");		if (0 >= write(fd, buff, strlen(buff)))			ERROR_EXIT("write");		printf("write: %s/n", buff);	}	exit(EXIT_SUCCESS);	return 0;}
开发者ID:chuandong,项目名称:C-code,代码行数:26,


示例8: priv_sock_recv_str

void priv_sock_recv_str(int fd, char *buf, int len){	int rlen = priv_sock_recv_int(fd);	if (rlen > len)		ERROR_EXIT("priv_sock_recv_str");	if (readn(fd, buf, rlen) != rlen)		ERROR_EXIT("priv_sock_recv_str");}
开发者ID:dcant,项目名称:zftp,代码行数:8,


示例9: evtchn_bind_pirq

static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind){    struct evtchn *chn;    struct domain *d = current->domain;    struct vcpu   *v = d->vcpu[0];    struct pirq   *info;    int            port, pirq = bind->pirq;    long           rc;    if ( (pirq < 0) || (pirq >= d->nr_pirqs) )        return -EINVAL;    if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )        return -EPERM;    spin_lock(&d->event_lock);    if ( pirq_to_evtchn(d, pirq) != 0 )        ERROR_EXIT(-EEXIST);    if ( (port = get_free_port(d)) < 0 )        ERROR_EXIT(port);    chn = evtchn_from_port(d, port);    info = pirq_get_info(d, pirq);    if ( !info )        ERROR_EXIT(-ENOMEM);    info->evtchn = port;    rc = (!is_hvm_domain(d)          ? pirq_guest_bind(v, info,                            !!(bind->flags & BIND_PIRQ__WILL_SHARE))          : 0);    if ( rc != 0 )    {        info->evtchn = 0;        pirq_cleanup_check(info, d);        goto out;    }    chn->state  = ECS_PIRQ;    chn->u.pirq.irq = pirq;    link_pirq_port(port, chn, v);    bind->port = port;#ifdef CONFIG_X86    if ( is_hvm_domain(d) && domain_pirq_to_irq(d, pirq) > 0 )        map_domain_emuirq_pirq(d, pirq, IRQ_PT);#endif out:    spin_unlock(&d->event_lock);    return rc;}
开发者ID:Kylinux,项目名称:XenKylinx,代码行数:56,


示例10: file_WriteFileData

/* Writes data out in block sizes of 16KB. Does destroy the data. * Assumes the data buffer has a space reserved at beginning for a blockMark. */static afs_int32file_WriteFileData(struct butm_tapeInfo *info, char *data, afs_int32 blocks, afs_int32 len){    afs_int32 code = 0;    int length;    afs_int32 b;    char *bstart;		/* Where block starts for a 16K block */    char *dstart;		/* Where data  starts for a 16K block */    if (info->debug)	printf("butm: Write tape data - %u bytes/n", len);    POLL();    info->error = 0;    code = check(info, WRITE_OP);    if (code)	ERROR_EXIT(code);    if (!data || (len < 0))	ERROR_EXIT(BUTM_BADARGUMENT);    if (READS || !WRITES)	ERROR_EXIT(BUTM_BADOP);    b = 0;			/* start at block 0 */    while (len > 0) {	dstart = &data[b * BUTM_BLKSIZE];	bstart = dstart - sizeof(struct blockMark);	if (len < BUTM_BLKSIZE) {	    memset(&dstart[len], 0, BUTM_BLKSIZE - len);	    length = len;	} else {	    length = BUTM_BLKSIZE;	}	code = WriteTapeBlock(info, bstart, length, BLOCK_DATA);	len -= length;	/* If there are more blocks, step to next block */	/* Otherwise, copy the data to beginning of last block */	if (b < (blocks - 1))	    b++;	else if (len)	    memcpy(&dstart[0], &dstart[BUTM_BLKSIZE], len);    }  error_exit:    return (code);}
开发者ID:bagdxk,项目名称:openafs,代码行数:54,


示例11: main

int main(){   psocMemoryFile  mem;   psocErrorHandler errorHandler;   void *          pAddr = NULL;   bool ok;#if ! defined(WIN32)   struct sigaction newAction, oldAction;#endif   /* The rename is a work around for a bug on Windows. It seems that the delete    * call is not as synchroneous as it should be...    */   rename( "MemFile.mem", "MemFile.old" );   unlink( "MemFile.old" );      psocInitErrorDefs();   psocInitErrorHandler( &errorHandler );   psocInitMemoryFile( &mem, 10, "MemFile.mem" );   ok = psocCreateBackstore( &mem, 0755, &errorHandler );   if ( ok != true ) {      ERROR_EXIT( expectedToPass, &errorHandler, unlink( "MemFile.mem" ) );   }      ok = psocOpenMemFile( &mem, &pAddr, &errorHandler );   if ( ok != true ) {      ERROR_EXIT( expectedToPass, &errorHandler, unlink( "MemFile.mem" ) );   }      ok = psocSetReadOnly( &mem, &errorHandler );   if ( ok != true ) {      ERROR_EXIT( expectedToPass, &errorHandler, unlink( "MemFile.mem" ) );   }      /* This should crash the whole thing. We intercept it with a signal.    * This way, if there is no memory violation, we will know.    */#if defined(WIN32)   signal(SIGSEGV, signalHandler );#else   newAction.sa_handler = signalHandler;   newAction.sa_flags   = SA_RESTART;   sigaction( SIGSEGV, &newAction, &oldAction );#endif   ((char*)pAddr)[0] = 'x';   ((char*)pAddr)[1] = 'y';   ERROR_EXIT( expectedToPass, NULL, unlink( "MemFile.mem" ) );}
开发者ID:dprevost,项目名称:photon,代码行数:51,


示例12: file_SeekEODump

/* * Seek to the EODump (end-of-dump) after the given position. This is * the position after the EOF filemark immediately after the EODump mark. * This is for tapes of version 4 or greater. */static afs_int32file_SeekEODump(struct butm_tapeInfo *info, afs_int32 position){    afs_int32 code = 0;    afs_int32 blockType;    afs_int32 w;    struct progress *p;    afs_int64 stopOff;	/* file seek offsets */    if (info->debug)	printf("butm: Seek to end-of-dump/n");    info->error = 0;    code = check(info, READ_OP);    if (code)	ERROR_EXIT(code);    if (READS || WRITES)	ERROR_EXIT(BUTM_BADOP);    if (isafile) {	p = (struct progress *)info->tmRock;	w = USD_SEEK(p->fid, 0, SEEK_END, &stopOff);	if (w) {	    info->error = w;	    ERROR_EXIT(BUTM_POSITION);	}	if (stopOff % BUTM_BLOCKSIZE)	    ERROR_EXIT(BUTM_POSITION);	info->position = (stopOff / BUTM_BLOCKSIZE);    } else {	/* Seek to the desired position */	code = SeekFile(info, (position - info->position) + 1);	if (code)	    ERROR_EXIT(code);	/*	 * Search until the filemark is an EODump filemark.	 * Skip over volumes only.	 */	while (1) {	    code = ReadTapeBlock(info, tapeBlock, &blockType);	    if (code)		ERROR_EXIT(code);	    if (blockType == BLOCK_EOD)		break;	    if (blockType != BLOCK_FMBEGIN)		ERROR_EXIT(BUTM_BADBLOCK);	    code = SeekFile(info, 1);	/* Step forward to next volume */	    if (code)		ERROR_EXIT(code);	}	code = 0;    }  error_exit:    return (code);}
开发者ID:bagdxk,项目名称:openafs,代码行数:65,


示例13: main

int main(){   psocMemoryFile  mem;   psocErrorHandler errorHandler;   void*           pAddr = NULL;   bool ok;      /* The rename is a work around for a bug on Windows. It seems that the delete    * call is not as synchroneous as it should be...    */   rename( "MemFile.mem", "MemFile.old" );   unlink( "MemFile.old" );      psocInitErrorDefs();   psocInitErrorHandler( &errorHandler );   psocInitMemoryFile( &mem, 10, "MemFile.mem" );   ok = psocCreateBackstore( &mem, 0755, &errorHandler );   if ( ok != true ) {      ERROR_EXIT( expectedToPass, &errorHandler, unlink( "MemFile.mem" ) );   }      ok = psocOpenMemFile( &mem, &pAddr, &errorHandler );   if ( ok != true ) {      ERROR_EXIT( expectedToPass, &errorHandler, unlink( "MemFile.mem" ) );   }      psocCloseMemFile( &mem, &errorHandler );      if ( mem.fileHandle != PSO_INVALID_HANDLE ) {      ERROR_EXIT( expectedToPass, NULL, unlink( "MemFile.mem" ) );   }   if ( mem.baseAddr   != PSO_MAP_FAILED ) {      ERROR_EXIT( expectedToPass, NULL, unlink( "MemFile.mem" ) );   }#if defined (WIN32)   if ( mem.mapHandle != PSO_INVALID_HANDLE ) {      ERROR_EXIT( expectedToPass, NULL, unlink( "MemFile.mem" ) );   }#endif   unlink( "MemFile.mem" );      psocFiniMemoryFile( &mem );   psocFiniErrorHandler( &errorHandler );   psocFiniErrorDefs();   return 0;}
开发者ID:dprevost,项目名称:photon,代码行数:50,


示例14: evtchn_bind_pirq

static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind){    struct evtchn *chn;    struct domain *d = current->domain;    struct vcpu   *v = d->vcpu[0];    int            port, pirq = bind->pirq;    long           rc;    if ( (pirq < 0) || (pirq >= d->nr_pirqs) )        return -EINVAL;    if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )        return -EPERM;    spin_lock(&d->event_lock);    if ( d->pirq_to_evtchn[pirq] != 0 )        ERROR_EXIT(-EEXIST);    if ( (port = get_free_port(d)) < 0 )        ERROR_EXIT(port);    chn = evtchn_from_port(d, port);    d->pirq_to_evtchn[pirq] = port;    rc = (!is_hvm_domain(d)          ? pirq_guest_bind(              v, pirq, !!(bind->flags & BIND_PIRQ__WILL_SHARE))          : 0);    if ( rc != 0 )    {        d->pirq_to_evtchn[pirq] = 0;        goto out;    }    chn->state  = ECS_PIRQ;    chn->u.pirq.irq = pirq;    link_pirq_port(port, chn, v);    bind->port = port;    if ( is_hvm_domain(d) && domain_pirq_to_irq(d, pirq) > 0 )        map_domain_emuirq_pirq(d, pirq, IRQ_PT); out:    spin_unlock(&d->event_lock);    return rc;}
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:49,


示例15: mapnode_new

mapnode_t *mapnode_new(){	mapnode_t *ptr;	ptr = calloc(1, sizeof(mapnode_t));	if (!ptr)		ERROR_EXIT();	ptr->adj = calloc(1, sizeof(struct adj_st));	if (!ptr->adj)		ERROR_EXIT();	return ptr;}
开发者ID:mtmiron,项目名称:lich,代码行数:15,


示例16: evtchn_bind_ipi

static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind){    struct evtchn *chn;    struct domain *d = current->domain;    int            port, vcpu = bind->vcpu;    long           rc = 0;    if ( (vcpu < 0) || (vcpu >= ARRAY_SIZE(d->vcpu)) ||         (d->vcpu[vcpu] == NULL) )        return -ENOENT;    spin_lock(&d->evtchn_lock);    if ( (port = get_free_port(d)) < 0 )        ERROR_EXIT(port);    chn = evtchn_from_port(d, port);    chn->state          = ECS_IPI;    chn->notify_vcpu_id = vcpu;    bind->port = port; out:    spin_unlock(&d->evtchn_lock);    return rc;}
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:27,


示例17: priv_sock_recv_int

int priv_sock_recv_int(int fd){	int r;	if (readn(fd, &r, sizeof(r)) != sizeof(r))		ERROR_EXIT("readn");	return r;}
开发者ID:dcant,项目名称:zftp,代码行数:7,


示例18: handle_ftpcmd

void handle_ftpcmd(session_t *sess){	char buf[MAXCMD] = {0};	sprintf(buf, "Welcome to zftp!/r/n%d", FTP_READY);	ftp_cmdio_write_m(sess->ctrl_fd, FTP_READY, buf);	while (1) {		start_signal_alarm_ctrl();		_reset_session_cmd(sess);		int ret = ftp_cmdio_get_cmd_args(sess->ctrl_fd, sess->ftp_cmd_line,			MAXCMD);		if (ret == -1) {			if (errno == EINTR)				continue;			ERROR_EXIT("ftp_cmdio_get_cmd_args");		} else if (ret == 0)			exit(0);		str_trim_crlf(sess->ftp_cmd_line);		str_split(sess->ftp_cmd_line, sess->ftp_cmd_op,			sess->ftp_cmd_arg, ' ');		str_toupper(sess->ftp_cmd_op);		_handle_map(sess);	}}
开发者ID:dcant,项目名称:zftp,代码行数:26,


示例19: getGeo

 /// implements Element::getGeo virtual int getGeo(GeoIndex i) const override {   switch (i)   {   case VERTEX:   case PARTS:   case NEIGH:     return 4;     break;   case EDGE:     return 6;   case FACE:     return 4;   case CENTER:     return 1;     break;   case DIMEN:     return 3;     break;   case BOUNDARY:     return 14;     break;   case PROJECTION:     return 10;     break;   default:     ERROR_EXIT("invalid geo-index/n");     return 0;   } }
开发者ID:spraetor,项目名称:amdis2,代码行数:31,


示例20: rewindFile

static afs_int32rewindFile(struct butm_tapeInfo *info){    struct progress *p;    afs_int32 code = 0;    afs_int32 error;    p = (struct progress *)info->tmRock;    POLL();    error = Rewind(p->fid);    POLL();    if (error) {	info->status |= BUTM_STATUS_SEEKERROR;	ERROR_EXIT(BUTM_IOCTL);    }    info->position = (isafile ? 0 : 1);    info->kBytes = info->nBytes = 0;    info->nFiles = info->nRecords = 0;    p->reading = p->writing = 0;  error_exit:    if (error)	info->error = error;    return (code);}
开发者ID:bagdxk,项目名称:openafs,代码行数:30,


示例21: handle_childcmd

void handle_childcmd(session_t *sess){//	tcp_server("192.168.1.251", 20);	// test whether drop_privilege succeed.	while (1) {		char cmd = priv_sock_recv_cmd(sess->parent_fd);		switch (cmd) {		case PRIV_SOCK_CHECK:			priv_op_check(sess);			break;		case PRIV_SOCK_CLOSE:			priv_op_close(sess);			break;		case PRIV_SOCK_LISTEN:			priv_op_listen(sess);			break;		case PRIV_SOCK_ACCEPT:			priv_op_accept(sess);			break;		case PRIV_SOCK_GET:			priv_op_get(sess);			break;		default:			ERROR_EXIT("handle_childcmd");		}	}}
开发者ID:dcant,项目名称:zftp,代码行数:26,


示例22: readDumps

/* Will read a dump, then see if there is a dump following it and * try to read that dump too. * The first tape label is the first dumpLabel. */intreadDumps(afs_uint32 taskId, struct butm_tapeInfo *tapeInfoPtr,          struct tapeScanInfo *scanInfoPtr){    afs_int32 code, c;    memcpy(&scanInfoPtr->dumpLabel, &scanInfoPtr->tapeLabel,           sizeof(struct butm_tapeLabel));    while (1) {        code = readDump(taskId, tapeInfoPtr, scanInfoPtr);        if (code)            ERROR_EXIT(code);        if (scanInfoPtr->tapeLabel.structVersion < TAPE_VERSION_4)            break;        /* Remember the initial dump and see if appended dump exists */        if (!scanInfoPtr->initialDumpId)            scanInfoPtr->initialDumpId = scanInfoPtr->dumpEntry.id;        c = butm_ReadLabel(tapeInfoPtr, &scanInfoPtr->dumpLabel, 0);	/* no rewind */        tapepos = tapeInfoPtr->position - 1;        if (c)            break;    }error_exit:    return (code);}
开发者ID:stevenjenkins,项目名称:openafs,代码行数:35,


示例23: addDirichletBC

    /// Adds a Dirichlet boundary condition, where the rhs is given by a DOF    /// vector.    void addDirichletBC(BoundaryType type, int row, int col,                        DOFVector<double>* vec) override    {      FUNCNAME("RosenbrockStationary::addDirichletBC()");      ERROR_EXIT("Not yet supported!/n");    }
开发者ID:spraetor,项目名称:amdis2,代码行数:9,


示例24: irc_eventloop

/* -------------------------------------------------------- */int irc_eventloop() {    /* -------------------------------------------------------- */    fd_set rset, wset, allRset, allWset;    int fdmax=0, nready;    char buf[MAX_MSG];    while( TRUE ) {        LIST *mybots= all_bots;        BOT	*bot	= NULL;        if(!mybots)            ERROR_EXIT("PANIC ?, entering eventloop without a bot!!/n");        memset(buf, '/0', MAX_MSG);        FD_ZERO(&allRset);        FD_ZERO(&allWset);        while( (bot = LIST_next(mybots)) ) {            if( bot->srv.sendbuf )                FD_SET(bot->srv.socket, &allWset);            FD_SET(bot->srv.socket, &allRset);            fdmax = fdmax > bot->srv.socket ? fdmax:bot->srv.socket;        }        rset = allRset;        wset = allWset;        /* select */        nready = select(fdmax+1, &rset, &wset, NULL, NULL);        if(nready==0) /* timeout (currently not usefull) */            continue;        if(nready<0)            ERROR_EXIT("error in select: %s!/n", strerror(errno));        mybots = all_bots;        bot = NULL;        while( (bot = LIST_next(mybots)) ) {            /* should we read from the server ? */            if(FD_ISSET(bot->srv.socket, &rset)) {                bot->srv.state = IRC_SYS_READ_EVENT;                irc_sys_state_maschine( bot );            }            /* should we write to the server ? */            if(FD_ISSET(bot->srv.socket, &wset)) {                bot->srv.state = IRC_SYS_WRITE_EVENT;                irc_sys_state_maschine( bot );            }        }    }    return IRC_ERROR;};
开发者ID:BackupTheBerlios,项目名称:ircbot,代码行数:48,


示例25: priv_sock_init

void priv_sock_init(session_t *sess){	int fds[2];	if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == -1)		ERROR_EXIT("socketpair");	sess->parent_fd = fds[0];	sess->child_fd = fds[1];}
开发者ID:dcant,项目名称:zftp,代码行数:8,


示例26: FUNCNAME

  double  CFE_NormAndErrorFcts::H1Err(    AbstractFunction<WorldVector<double>, WorldVector<double>>* u,    DOFVector<double>* uh,    ElementLevelSet* elLS,    int domainFlag,    int relErr,    int deg,    Quadrature* q)  {    FUNCNAME("CFE_NormAndErrorFcts::H1Err()");    int dim = elLS->getDim();    ElementH1Err* elNorm = new ElementH1Err(q, u, uh, relErr, dim);    TEST_EXIT(dim == Global::getGeo(WORLD))    ("doesn't work for dimension of problem != dimension of world!/n");    Flag fillFlag = Mesh::CALL_LEAF_EL |                    Mesh::FILL_COORDS |                    Mesh::FILL_DET |                    Mesh::FILL_GRD_LAMBDA;    double err = 0.0;    switch(domainFlag)    {    case -3:      err = Norm_IntNoBound(elNorm, elLS, fillFlag, deg, q);      break;    case -2:      err = Norm_IntBound(elNorm, elLS, fillFlag, deg, q);      break;    case -1:      err = Norm_Int(elNorm, elLS, fillFlag, deg, q);      break;    case 0:      err = Norm_Bound(elNorm, elLS, fillFlag, deg, q);      break;    case 1:      err = Norm_Complete(elNorm, elLS, fillFlag, deg, q);      break;    default:      ERROR_EXIT("illegal flag !/n");      break;    }    H1_err_abs = sqrt(err);    H1_u_norm = sqrt(elNorm->getNormGrdU());    if (relErr)      err = H1_err_abs / (H1_u_norm + 1.e-15);    else      err = H1_err_abs;    delete elNorm;    return err;  }
开发者ID:spraetor,项目名称:amdis2,代码行数:58,


示例27: saveTextFile

afs_int32saveTextFile(afs_int32 taskId, afs_int32 textType, char *fileName){    udbClientTextP ctPtr = 0;    afs_int32 code = 0;    int tlock = 0;    ctPtr = (udbClientTextP) malloc(sizeof(*ctPtr));    if (!ctPtr)	ERROR_EXIT(TC_NOMEMORY);    memset(ctPtr, 0, sizeof(*ctPtr));    ctPtr->textType = textType;    /* lock the text in the database */    code = bc_LockText(ctPtr);    if (code) {	ErrorLog(0, taskId, code, 0, "Can't lock text file/n");	ERROR_EXIT(code);    }    tlock = 1;    ctPtr->textStream = fopen(fileName, "r");    if (!ctPtr->textStream) {	ErrorLog(0, taskId, errno, 0, "Can't open text file/n");	ERROR_EXIT(errno);    }    /* now send the text to the database */    code = bcdb_SaveTextFile(ctPtr);    if (code) {	ErrorLog(0, taskId, code, 0, "Can't save text file/n");	ERROR_EXIT(code);    }  error_exit:    if (ctPtr) {	if (ctPtr->textStream)	    fclose(ctPtr->textStream);	if (tlock)	    bc_UnlockText(ctPtr);	free(ctPtr);    }    return (code);}
开发者ID:snktagarwal,项目名称:openafs,代码行数:45,


示例28: MSG_new

/* -------------------------------------------------------- */MSG * MSG_new(BOT *me) {    /* -------------------------------------------------------- */    MSG *ret = CALLOC(1, sizeof(MSG));    if(!ret)        ERROR_EXIT("MSG_new: error by calloc !!/n");    if(me)        ret->reciver = me;    return ret;}
开发者ID:BackupTheBerlios,项目名称:ircbot,代码行数:10,



注:本文中的ERROR_EXIT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ERROR_LOG函数代码示例
C++ ERROR_CHECK函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。