这篇教程C++ strerr_die2sys函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中strerr_die2sys函数的典型用法代码示例。如果您正苦于以下问题:C++ strerr_die2sys函数的具体用法?C++ strerr_die2sys怎么用?C++ strerr_die2sys使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了strerr_die2sys函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: normal_bottomvoid normal_bottom(char format)/* Copies bottom text and the original message to the new message */{ if (flagbottom) { copy(&qq,"text/bottom",flagcd); if (flagcd && format != RFC1153) { if (flagcd == 'B') { encodeB("",0,&line,2); /* flush */ qmail_put(&qq,line.s,line.len); } hdr_boundary(0); hdr_ctype(CTYPE_MESSAGE); hdr_adds("Content-Disposition: inline; filename=request.msg"); qmail_puts(&qq,"/n"); } qmail_puts(&qq,"Return-Path: <"); if (!quote2("ed,sender)) die_nomem(); qmail_put(&qq,quoted.s,quoted.len); qmail_puts(&qq,">/n"); if (seek_begin(0) == -1) strerr_die2sys(111,FATAL,MSG(ERR_SEEK_INPUT)); if (qmail_copy(&qq,&ssin2,copylines) != 0) strerr_die2sys(111,FATAL,MSG(ERR_READ_INPUT)); } else { if (flagcd == 'B' && format != RFC1153) { encodeB("",0,&line,2); /* flush */ qmail_put(&qq,line.s,line.len); } }}
开发者ID:abh,项目名称:ezmlm-idx,代码行数:30,
示例2: write_ulongvoid write_ulong(unsigned long num,unsigned long cum,unsigned long dat, const char *fn,const char *fnn)/* write num to "fnn" add ':' & cum if cum <>0, then move "fnn" to "fn" */{ int fd; fd = open_trunc(fnn); if (fd == -1) strerr_die2sys(111,FATAL,MSG1(ERR_CREATE,fnn)); substdio_fdbuf(&ssnum,write,fd,numbuf,sizeof(numbuf)); if (substdio_put(&ssnum,strnum,fmt_ulong(strnum,num)) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn)); if (substdio_puts(&ssnum,":") == -1) strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn)); if (substdio_put(&ssnum,strnum,fmt_ulong(strnum,cum)) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn)); if (dat) { if (substdio_puts(&ssnum,":") == -1) strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn)); if (substdio_put(&ssnum,strnum,fmt_ulong(strnum,dat)) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn)); } if (substdio_puts(&ssnum,"/n") == -1) strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnn)); if (substdio_flush(&ssnum) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_FLUSH,fnn)); if (fsync(fd) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_SYNC,fnn)); if (close(fd) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_CLOSE,fnn)); wrap_rename(fnn,fn);}
开发者ID:abh,项目名称:ezmlm-idx,代码行数:32,
示例3: mainmain(){ char *x; int udp53; x = env_get("IP"); if (!x) strerr_die2x(111,fatal,"$IP not set"); if (!ip4_scan(x,ip)) strerr_die3x(111,fatal,"unable to parse IP address ",x); udp53 = socket_udp(); if (udp53 == -1) strerr_die2sys(111,fatal,"unable to create UDP socket: "); if (socket_bind4_reuse(udp53,ip,53) == -1) strerr_die2sys(111,fatal,"unable to bind UDP socket: "); droproot(fatal); initialize(); ndelay_off(udp53); socket_tryreservein(udp53,65536); for (;;) { len = socket_recv4(udp53,buf,sizeof buf,ip,&port); if (len < 0) continue; if (!doit()) continue; if (response_len > 512) response_tc(); socket_send4(udp53,response,response_len,ip,port); /* may block for buffer space; if it fails, too bad */ }}
开发者ID:kjseefried,项目名称:didentd,代码行数:33,
示例4: mainint main(int argc,char **argv,char **envp){ int piin[2]; int piout[2]; pid[fmt_ulong(pid,getpid())] = 0; if (argc < 2) strerr_die1x(100,"recordio: usage: recordio program [ arg ... ]"); if (pipe(piin) == -1) strerr_die2sys(111,FATAL,"unable to create pipe: "); if (pipe(piout) == -1) strerr_die2sys(111,FATAL,"unable to create pipe: "); switch(fork()) { case -1: strerr_die2sys(111,FATAL,"unable to fork: "); case 0: sig_ignore(sig_pipe); close(piin[0]); close(piout[1]); doit(piin[1],piout[0]); } close(piin[1]); close(piout[0]); if (fd_move(0,piin[0]) == -1) strerr_die2sys(111,FATAL,"unable to move descriptors: "); if (fd_move(1,piout[1]) == -1) strerr_die2sys(111,FATAL,"unable to move descriptors: "); pathexec_run(argv[1],argv + 1,envp); strerr_die4sys(111,FATAL,"unable to run ",argv[1],": ");}
开发者ID:Safari77,项目名称:ucspi-tcp-safari,代码行数:35,
示例5: mainint main(int argc, char **argv, char **envp) { uint8_t buf[1024]; cdb_t cdb; char *key; uint32_t len; uint32_t r; uint32_t pos; uint32_t skip = 0; char *skip_str; if (!*argv || !*++argv) usage(); key = *argv; skip_str = *++argv; if (skip_str) { if (sscanf(skip_str, "%" PRIu32, &skip) != strlen(skip_str)) usage(); } /* Initialize the cdb struct using stdin as it's file descriptor. */ if (cdb_init(&cdb, 0) == -1) strerr_die2x(111, FATAL, "failed to initialize cdb"); for (;;) { r = cdb_find_next(&cdb, key, strlen(key)); if (r == -1) strerr_die2sys(111, FATAL, "unable to read input: "); if (!r) _exit(100); if (!skip) break; skip--; } /* If there's a record in the cdb file, then the cdb structs dlen property * will be set to a non-zero value and it's position will be set to the * offset in the file containing the data. Read the data in chunks and send * it to stdout. */ len = cdb.dlen; pos = cdb.dpos; while (len > 0) { r = sizeof(buf); if (r > len) r = len; if (cdb_read(buf, r, &cdb, pos) == -1) strerr_die2sys(111, FATAL, "unable to read input: "); if (bio_put(bio_1, buf, r) == -1) strerr_die2sys(111, FATAL, "unable to write output: "); pos += r; len -= r; } if (bio_flush(bio_1) == -1) strerr_die2sys(111, FATAL, "unable to write output: "); cdb_free(&cdb); return 0;}
开发者ID:dpejesh,项目名称:svcdb,代码行数:60,
示例6: copybottomvoid copybottom(int forcebottom){ if (!omitbottom || forcebottom) { copy(&qq,"text/bottom",flagcd); if (flagcd) { if (flagcd == 'B') { encodeB("",0,&line,2); /* flush */ qmail_put(&qq,line.s,line.len); } hdr_boundary(0); hdr_ctype(CTYPE_MESSAGE); hdr_adds("Content-Disposition: inline; filename=request.msg"); qmail_puts(&qq,"/n"); } qmail_puts(&qq,"Return-Path: <"); quote2("ed,sender); qmail_put(&qq,quoted.s,quoted.len); qmail_puts(&qq,">/n"); if (seek_begin(0) == -1) strerr_die2sys(111,FATAL,MSG(ERR_SEEK_INPUT)); if (qmail_copy(&qq,&ssin2,copylines) != 0) strerr_die2sys(111,FATAL,MSG(ERR_READ_INPUT)); if (flagcd) hdr_boundary(1); } else { if (flagcd == 'B') { encodeB("",0,&line,2); /* flush even if no bottom */ qmail_put(&qq,line.s,line.len); } } qmail_from(&qq,from.s);}
开发者ID:chayapan-computing,项目名称:ezmlm-idx,代码行数:33,
示例7: mainint main(int argc,const char *const *argv,const char *const *envp){ struct passwd *pw; const char *account; char strnum[FMT_ULONG]; account = *++argv; if (!account || !*++argv) usage(); pw = getpwnam(account); if (!pw) strerr_die3x(111,FATAL,"unknown account ",account); if (!pathexec_env("HOME",pw->pw_dir)) nomem(); if (!pathexec_env("SHELL",pw->pw_shell)) nomem(); if (!pathexec_env("USER",pw->pw_name)) nomem(); strnum[fmt_ulong(strnum,pw->pw_gid)] = 0; if (!pathexec_env("GID",strnum)) nomem(); strnum[fmt_ulong(strnum,pw->pw_uid)] = 0; if (!pathexec_env("UID",strnum)) nomem(); if (chdir(pw->pw_dir) != 0) strerr_die3sys(111,FATAL,"unable to chdir to ", pw->pw_dir); if (prot_gid(pw->pw_gid) == -1) strerr_die2sys(111,FATAL,"unable to setgid"); if (prot_gids(pw->pw_name, pw->pw_gid) == -1) strerr_die2sys(111,FATAL,"unable to initgroups"); if (prot_uid(pw->pw_uid) == -1) strerr_die2sys(111,FATAL,"unable to setuid"); pathexec_run(*argv,argv,envp); strerr_die3sys(111,FATAL,"unable to run ",*argv);}
开发者ID:bruceg,项目名称:daemontools-encore,代码行数:34,
示例8: didentd_initvoid didentd_init(){ char *x; unsigned long id; x = env_get("ROOT"); if (!x) strerr_die2x(111,FATAL,"$ROOT not set"); if (chdir(x) == -1) strerr_die4sys(111,FATAL,"unable to chdir to ",x,": "); x = env_get("GID"); if (!x) strerr_die2x(111,FATAL,"$GID not set"); scan_ulong(x,&id); if (prot_gid((int) id) == -1) strerr_die2sys(111,FATAL,"unable to setgid: "); x = env_get("UID"); if (!x) strerr_die2x(111,FATAL,"$UID not set"); scan_ulong(x,&id); if (prot_uid((int) id) == -1) strerr_die2sys(111,FATAL,"unable to setuid: ");}
开发者ID:kjseefried,项目名称:didentd,代码行数:25,
示例9: didentd_initvoid didentd_init(){ /* chroot() to /proc/net/ and switch to $UID:$GID */ char *x; unsigned long id; if (chdir("/proc/net/") == -1) strerr_die2sys(111,FATAL,"unable to chdir to '/proc/net/': "); if (chroot(".") == -1) strerr_die2sys(111,FATAL,"unable to chdir to '/proc/net/': "); x = env_get("GID"); if (!x) strerr_die2x(111,FATAL,"$GID not set"); scan_ulong(x,&id); if (prot_gid((int) id) == -1) strerr_die2sys(111,FATAL,"unable to setgid: "); x = env_get("UID"); if (!x) strerr_die2x(111,FATAL,"$UID not set"); scan_ulong(x,&id); if (prot_uid((int) id) == -1) strerr_die2sys(111,FATAL,"unable to setuid: ");}
开发者ID:kjseefried,项目名称:didentd,代码行数:25,
示例10: do_getstatic void do_get(const char *action){ unsigned long u; struct stat st; char ch; int r; unsigned int pos; int fd; if (!flagget) strerr_die2x(100,FATAL,MSG(ERR_NOT_AVAILABLE)); hdr_subject(MSG(SUB_GET_MSG)); hdr_ctboundary(); copy(&qq,"text/top",flagcd); pos = str_len(ACTION_GET); if (!case_starts(action,ACTION_GET)) pos = str_len(ALT_GET); if (action[pos] == '.' || action [pos] == '_') pos++; scan_ulong(action + pos,&u); stralloc_copys(&line,"archive/"); stralloc_catb(&line,strnum,fmt_ulong(strnum,u / 100)); stralloc_cats(&line,"/"); stralloc_catb(&line,strnum,fmt_uint0(strnum,(unsigned int) (u % 100),2)); stralloc_0(&line); fd = open_read(line.s); if (fd == -1) if (errno != error_noent) strerr_die2sys(111,FATAL,MSG1(ERR_OPEN,line.s)); else copy_act("text/get-bad"); else { if (fstat(fd,&st) == -1) copy_act("text/get-bad"); else if (!(st.st_mode & 0100)) copy_act("text/get-bad"); else { showsend("get"); substdio_fdbuf(&sstext,read,fd,textbuf,sizeof(textbuf)); qmail_puts(&qq,"> "); for (;;) { r = substdio_get(&sstext,&ch,1); if (r == -1) strerr_die2sys(111,FATAL,MSG1(ERR_READ,line.s)); if (r == 0) break; qmail_put(&qq,&ch,1); if (ch == '/n') qmail_puts(&qq,"> "); } qmail_puts(&qq,"/n"); } close(fd); } copybottom(0); qmail_to(&qq,target.s);}
开发者ID:chayapan-computing,项目名称:ezmlm-idx,代码行数:57,
示例11: f_closevoid f_close(void){ if (substdio_flush(&ss) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_FLUSH,dirplus.s)); if (fsync(ss.fd) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_SYNC,dirplus.s)); if (close(ss.fd) == -1) /* NFS stupidity */ strerr_die2sys(111,FATAL,MSG1(ERR_CLOSE,dirplus.s)); keyaddtime();}
开发者ID:bruceg,项目名称:ezmlm-idx,代码行数:10,
示例12: close_propervoid close_proper(substdio *ss,const char *s,const char *sn)/* flush,sync,close,move sn->s) */{ if (substdio_flush(ss) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_FLUSH,s)); if (flagsync) if (fsync(ss->fd) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_SYNC,s)); if (close(ss->fd) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_CLOSE,s)); wrap_rename(sn,s);}
开发者ID:bruceg,项目名称:ezmlm-idx,代码行数:12,
示例13: show/*void show(const char *desc, stralloc *s){ buffer_puts(buffer_2,desc); buffer_puthex(buffer_2,s->s,s->len); buffer_putsflush(buffer_2,"/n");}*/int main(int argc, char * argv[]){ int r; const char* pk0; const char* sk0; /* Check args */ pk0 = ((argc<2) ? env_get("NACL_PUBLICKEY_FILE") : argv[1]); sk0 = ((argc<3) ? env_get("NACL_SECRETKEY_FILE") : argv[2]); if(pk0==0 || sk0==0) strerr_die1x(100,"crypto-box: usage: crypto-box [ publickeyfile ] [ secretkeyfile ]"); /* Read public key */ if(openreadclose(argv[1],&pk,crypto_box_PUBLICKEYBYTES)<=0) strerr_die2sys(111,FATAL,"unable to read public key: "); /* Read secret key */ if(openreadclose(argv[2],&sk,crypto_box_SECRETKEYBYTES)<=0) strerr_die2sys(111,FATAL,"unable to read secret key: "); /* Create shared key */ if(crypto_str_box_beforenm(&k,&pk,&sk)) strerr_die2x(111,FATAL,"failed to create shared-key"); /* Decrypt each chunk */ for (;;) { /* Read nonce */ if((r=netstring_read(buffer_0,&n))!=0) strerr_die2x(111,FATAL,"failed to read nonce"); if(n.len==0) break; if(n.len!=crypto_box_NONCEBYTES) strerr_die2x(111,FATAL,"nonce was incorrect size"); /* Read cipher */ if(netstring_read(buffer_0,&c)!=0) strerr_die2x(111,FATAL,"failed to read cipher"); /* Decrypt message */ if(crypto_str_box_open_afternm(&m,&c,&n,&k)!=0) strerr_die2x(111,FATAL,"decryption failed"); /* Write message */ if(buffer_put(buffer_1,m.s,m.len)!=0) strerr_die2sys(111,FATAL,"failed to output message: "); } buffer_flush(buffer_1); return 0;}
开发者ID:notfed,项目名称:nacltools,代码行数:60,
示例14: stralloc_0const char *get_from(const char *adr, /* target address */ const char *act) /* action *//* If we captured a from line, it will be from the subscriber, except *//* when -S is used when it's usually from the subscriber, but of course *//* could be from anyone. The matching to stored data is required only *//* to support moderated lists, and in cases where a new -sc is issued *//* because an old one was invalid. In this case, we read through the *//* from file trying to match up a timestamp with that starting in *//* *(act+3). If the time stamp matches, we compare the target address *//* itself. act + 3 must be a legal part of the string returns pointer to*//* fromline, NULL if not found. Since the execution time from when to *//* storage may differ, we can't assume that the timestamps are in order.*/{ int fd; const char *fl; unsigned int pos; unsigned long thistime; unsigned long linetime; if (!flagstorefrom) return 0; if (fromline.len) { /* easy! We got it in this message */ stralloc_0(&fromline); return fromline.s; } /* need to recover it from DIR/from */ fl = 0; (void) scan_ulong(act+3,&thistime); if ((fd = open_read("from")) == -1) { if (errno == error_noent) return 0; else strerr_die2sys(111,FATAL,MSG1(ERR_READ,"from")); } substdio_fdbuf(&sstext,read,fd,textbuf,(int) sizeof(textbuf)); for (;;) { if (getln(&sstext,&fromline,&match,'/n') == -1) strerr_die2sys(111,FATAL,MSG1(ERR_READ,"from")); if (!match) break; fromline.s[fromline.len - 1] = (char) 0; /* now:time addr/0fromline/0 read all. They can be out of order! */ pos = scan_ulong(fromline.s,&linetime); if (linetime != thistime) continue; if (!str_diff(fromline.s + pos + 1,adr)) { pos = str_len(fromline.s); if (pos < fromline.len) { fl = fromline.s + pos + 1; break; } } } close(fd); return fl;}
开发者ID:chayapan-computing,项目名称:ezmlm-idx,代码行数:52,
示例15: linkdotdirvoid linkdotdir(const char *dash,const char *slash){ stralloc_copy(&dotplus,&dot); stralloc_cats(&dotplus,dash); stralloc_0(&dotplus); dirplusmake(slash); if (flags['e' - 'a']) if (unlink(dotplus.s) == -1) if (errno != error_noent) strerr_die2sys(111,FATAL,MSG1(ERR_DELETE,dotplus.s)); if (symlink(dirplus.s,dotplus.s) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_CREATE,dotplus.s)); keyaddtime();}
开发者ID:bruceg,项目名称:ezmlm-idx,代码行数:14,
示例16: mainmain(){ int pid; int wstat; char ch; sig_ignore(sig_pipe); pid = fork(); if (pid == -1) strerr_die2sys(111,"mconnect-io: fatal: ","unable to fork: "); if (!pid) { buffer_init(&bin,myread,0,inbuf,sizeof inbuf); buffer_init(&bout,write,7,outbuf,sizeof outbuf); while (buffer_get(&bin,&ch,1) == 1) { if (ch == '/n') buffer_put(&bout,"/r",1); buffer_put(&bout,&ch,1); } _exit(0); } buffer_init(&bin,myread,6,inbuf,sizeof inbuf); buffer_init(&bout,write,1,outbuf,sizeof outbuf); while (buffer_get(&bin,&ch,1) == 1) buffer_put(&bout,&ch,1); kill(pid,sig_term); wait_pid(&wstat,pid); _exit(0);}
开发者ID:KodeKreatif,项目名称:ucspi-tcp,代码行数:33,
示例17: f_initvoid f_init(char **script){ int i; int fd; for (i = 0;script[i];++i) ; f = (int *) alloc(i * sizeof(*f)); if (!f) strerr_die2x(111,FATAL,"out of memory"); for (i = 0;script[i];++i) { fd = -1; if (script[i][0] == '=') { if (fchdir(fdstartdir) == -1) strerr_die2sys(111,FATAL,"unable to switch to starting directory: "); fd = open_append(script[i] + 1); if (fd == -1) strerr_die4sys(111,FATAL,"unable to create ",script[i] + 1,": "); close(fd); fd = open_write(script[i] + 1); if (fd == -1) strerr_die4sys(111,FATAL,"unable to write ",script[i] + 1,": "); coe(fd); } f[i] = fd; }}
开发者ID:schmurfy,项目名称:daemontools,代码行数:28,
示例18: getvoid get(stralloc *sa){ int match; if (getln(subfdin,sa,&match,'/n') == -1) strerr_die2sys(111,FATAL,MSG(ERR_READ_INPUT)); if (!match) _exit(0);}
开发者ID:abh,项目名称:ezmlm-idx,代码行数:7,
示例19: frmvoid frm(const char *slash){ dirplusmake(slash); if (unlink(dirplus.s) == -1) if (errno != error_noent) strerr_die2sys(111,FATAL,MSG1(ERR_DELETE,dirplus.s));}
开发者ID:bruceg,项目名称:ezmlm-idx,代码行数:7,
示例20: execute_linestatic int execute_line(const char *fn,const char *line){ int child; int code; if (seek_begin(0) == -1) strerr_die2sys(111,FATAL,MSG(ERR_SEEK_INPUT)); while (*line && (*line == '/t' || *line == ' ')) ++line; switch (*line) { case '#': /* ignore comments */ return 0; case '|': if ((child = wrap_fork()) == 0) wrap_execsh(line+1); code = wrap_waitpid(child); ++did_program; return code; case '/': case '.': strerr_die5x(100,FATAL,basedir.s,"/",fn,": Delivery to files is not supported."); return 100; default: if (*line == '&') ++line; forward(line); return 0; }}
开发者ID:debdungeon,项目名称:qint,代码行数:31,
示例21: flushitstatic void flushit(int fd){ if (fd > 0) if (substdio_flush(&ssarchive) == -1 || fchmod(fd,MODE_ARCHIVE|0700) == -1 || close(fd) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_WRITE,fnaf.s));}
开发者ID:bruceg,项目名称:ezmlm-idx,代码行数:8,
示例22: wrap_statint wrap_stat(const char *fn,struct stat *st){ int r; if ((r = stat(fn,st)) == -1 && errno != error_noent) strerr_die2sys(111,FATAL,MSG1(ERR_STAT,fn)); return r;}
开发者ID:abh,项目名称:ezmlm-idx,代码行数:8,
示例23: dcreatevoid dcreate(const char *slash){ dirplusmake(slash); if (mkdir(dirplus.s,0755) == -1) if ((errno != error_exist) || !flags['e' - 'a']) strerr_die2sys(111,FATAL,MSG1(ERR_CREATE,dirplus.s)); keyaddtime();}
开发者ID:bruceg,项目名称:ezmlm-idx,代码行数:8,
示例24: open_templatestatic int open_template(stralloc *fn){ int fd; struct stat st; stralloc_0(fn); if (stat(fn->s,&st) == -1) strerr_die2sys(111,FATAL,MSG1(ERR_STAT,fn->s)); if (S_ISDIR(st.st_mode)) { --fn->len; stralloc_cats(fn,TXT_EZMLMRC); stralloc_0(fn); } if ((fd = open_read(fn->s)) == -1) { if (errno != error_noent) strerr_die2sys(111,FATAL,MSG1(ERR_OPEN,fn->s)); else strerr_die3x(100,FATAL,template.s,MSG(ERR_NOEXIST));
开发者ID:bruceg,项目名称:ezmlm-idx,代码行数:17,
示例25: mainint main(int argc,const char *const *argv,const char *const *envp){ account = *++argv; if (!account || !*++argv) strerr_die1x(100,"setuidgid: usage: setuidgid account child"); pw = getpwnam(account); if (!pw) strerr_die3x(111,FATAL,"unknown account ",account); if (prot_gid(pw->pw_gid) == -1) strerr_die2sys(111,FATAL,"unable to setgid: "); if (prot_uid(pw->pw_uid) == -1) strerr_die2sys(111,FATAL,"unable to setuid: "); pathexec_run(*argv,argv,envp); strerr_die4sys(111,FATAL,"unable to run ",*argv,": ");}
开发者ID:ajtulloch,项目名称:daemontools,代码行数:18,
示例26: read_passwdvoid read_passwd(void) { if (!password.len) { buffer_init(&b,buffer_unixread,3,bspace,sizeof bspace); if (getln(&b,&password,&match,'/0') == -1) strerr_die2sys(111,FATAL,"unable to read password: "); close(3); if (match) --password.len; }}
开发者ID:giamteckchoon,项目名称:ucspi-ssl-0.73-ipv6,代码行数:9,
示例27: defaultsoa_initvoid defaultsoa_init(int fd){ struct stat st; if (fstat(fd,&st) == -1) strerr_die2sys(111,FATAL,"unable to stat data: "); uint32_pack_big(defaultsoa,st.st_mtime); if (byte_equal(defaultsoa,4,"/0/0/0/0")) defaultsoa[3] = 1; byte_copy(defaultsoa + 4,16,"/0/0/100/000/0/0/010/000/0/020/000/000/0/0/012/000");}
开发者ID:axlecrusher,项目名称:djbdns,代码行数:10,
示例28: existsint exists(const char *dpm){ struct stat st; dirplusmake(dpm); if (stat(dirplus.s,&st) == -1) { if (errno == error_noent) return 0; strerr_die2sys(111,FATAL,MSG1(ERR_STAT,dirplus.s)); } return 1;}
开发者ID:bruceg,项目名称:ezmlm-idx,代码行数:11,
示例29: doitvoid doit(int resource,const char *arg){ unsigned long u; struct rlimit r; if (getrlimit(resource,&r) == -1) strerr_die2sys(111,FATAL,"getrlimit failed: "); if (str_equal(arg,"=")) r.rlim_cur = r.rlim_max; else { if (arg[scan_ulong(arg,&u)]) die_usage(); r.rlim_cur = u; if (r.rlim_cur > r.rlim_max) r.rlim_cur = r.rlim_max; } if (setrlimit(resource,&r) == -1) strerr_die2sys(111,FATAL,"setrlimit failed: ");}
开发者ID:ajtulloch,项目名称:daemontools,代码行数:20,
注:本文中的strerr_die2sys函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ strerr_die2x函数代码示例 C++ strequal函数代码示例 |