Changeset c6a5f6843e8c4487fe86123f4f910a49ebe29558
- Timestamp:
- 05/26/10 01:39:33
(3 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1274837973 +0000
- git-parent:
[86e1c05fa7c180d9d908fc39e800e0ed70c8aeb8]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1274837973 +0000
- Message:
dead assignments, refs #283
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r6d95549 |
rc6a5f68 |
|
| 794 | 794 | noit_metric_guess_type(const char *s, void **replacement) { |
|---|
| 795 | 795 | char *copy, *cp, *trailer, *rpl; |
|---|
| 796 | | int negative = 0, bigF = 0; |
|---|
| | 796 | int negative = 0; |
|---|
| 797 | 797 | metric_type_t type = METRIC_STRING; |
|---|
| 798 | 798 | |
|---|
| … | … | |
| 866 | 866 | |
|---|
| 867 | 867 | exponent: |
|---|
| 868 | | if(s[0] == 'E') bigF = 1; /* We want the caps variant */ |
|---|
| 869 | 868 | s++; |
|---|
| 870 | 869 | if(s[0] != '-' && s[0] != '+') goto notanumber; |
|---|
| r88a7178 |
rc6a5f68 |
|
| 98 | 98 | const LineInfo *li; |
|---|
| 99 | 99 | char **cmds, *curstr; |
|---|
| 100 | | int len, i, cnt = 32; |
|---|
| | 100 | int len, cnt = 32; |
|---|
| 101 | 101 | |
|---|
| 102 | 102 | li = el_line(el); |
|---|
| … | … | |
| 107 | 107 | |
|---|
| 108 | 108 | cmds = alloca(32 * sizeof(*cmds)); |
|---|
| 109 | | i = noit_tokenize(curstr, cmds, &cnt); |
|---|
| | 109 | (void) noit_tokenize(curstr, cmds, &cnt); |
|---|
| 110 | 110 | |
|---|
| 111 | 111 | el_get(el, EL_USERDATA, (void *)&ncct); |
|---|
| r8135eae |
rc6a5f68 |
|
| 515 | 515 | |
|---|
| 516 | 516 | if(!argc) { |
|---|
| 517 | | noit_console_state_stack_t *i = current; |
|---|
| | 517 | noit_console_state_stack_t *i; |
|---|
| 518 | 518 | if(!current) { |
|---|
| 519 | 519 | nc_printf(ncct, "no state!\n"); |
|---|
| r0b1d2f2 |
rc6a5f68 |
|
| 1799 | 1799 | noit_console_telnet_closure_t |
|---|
| 1800 | 1800 | noit_console_telnet_alloc(noit_console_closure_t ncct) { |
|---|
| 1801 | | int on; |
|---|
| 1802 | 1801 | noit_console_telnet_closure_t telnet, tmp; |
|---|
| 1803 | 1802 | static unsigned char ttytype_sbbuf[] = { |
|---|
| … | … | |
| 1826 | 1825 | if (my_state_is_wont(TELOPT_ECHO)) |
|---|
| 1827 | 1826 | send_will(TELOPT_ECHO, 1); |
|---|
| 1828 | | on = 1; |
|---|
| 1829 | 1827 | init_termbuf(ncct); |
|---|
| 1830 | 1828 | #ifdef LINEMODE |
|---|
| rc9dd5d8 |
rc6a5f68 |
|
| 1078 | 1078 | r->next = n; |
|---|
| 1079 | 1079 | n->prev = r; |
|---|
| 1080 | | r = n; |
|---|
| 1081 | 1080 | } |
|---|
| 1082 | 1081 | else { |
|---|
| 1083 | | r = ctx->res.output_raw = n; |
|---|
| | 1082 | ctx->res.output_raw = n; |
|---|
| 1084 | 1083 | } |
|---|
| 1085 | 1084 | } |
|---|
| r55b3471 |
rc6a5f68 |
|
| 510 | 510 | break; |
|---|
| 511 | 511 | case AF_UNIX: |
|---|
| 512 | | len = SUN_LEN(((struct sockaddr_un *)remote)); |
|---|
| 513 | 512 | snprintf(name, sizeof(name), "%s", ((struct sockaddr_un *)remote)->sun_path); |
|---|
| 514 | 513 | break; |
|---|
| rfa84adf |
rc6a5f68 |
|
| 396 | 396 | struct rest_xml_payload *rxc; |
|---|
| 397 | 397 | if(restc->call_closure == NULL) { |
|---|
| 398 | | rxc = restc->call_closure = calloc(1, sizeof(*rxc)); |
|---|
| | 398 | restc->call_closure = calloc(1, sizeof(*rxc)); |
|---|
| 399 | 399 | restc->call_closure_free = rest_xml_payload_free; |
|---|
| 400 | 400 | } |
|---|
| r77c2f1d |
rc6a5f68 |
|
| 348 | 348 | /* Reacquire the lock */ |
|---|
| 349 | 349 | if(*lockfile) { |
|---|
| 350 | | if((lockfd = noit_lockfile_acquire(lockfile)) < 0) { |
|---|
| | 350 | if(noit_lockfile_acquire(lockfile) < 0) { |
|---|
| 351 | 351 | noitL(noit_stderr, "Failed to acquire lock: %s\n", lockfile); |
|---|
| 352 | 352 | exit(-1); |
|---|
| r3c6cba1 |
rc6a5f68 |
|
| 265 | 265 | /* Force release these without holding the lock */ |
|---|
| 266 | 266 | while(cq) { |
|---|
| 267 | | prev = cq; |
|---|
| 268 | 267 | cq = cq->next; |
|---|
| 269 | 268 | release_conn_q_forceable(cq, 1); |
|---|
| r31fab75 |
rc6a5f68 |
|
| 248 | 248 | |
|---|
| 249 | 249 | /* Phase 4: clean the markings */ |
|---|
| 250 | | mgen = 0; |
|---|
| 251 | 250 | memset(&iter, 0, sizeof(iter)); |
|---|
| 252 | 251 | while(noit_hash_next(&stmt_by_id, &iter, &key, &klen, &vstmt)) { |
|---|
| … | … | |
| 442 | 441 | break; |
|---|
| 443 | 442 | case AF_UNIX: |
|---|
| 444 | | len = SUN_LEN(((struct sockaddr_un *)remote)); |
|---|
| 445 | 443 | snprintf(remote_str, sizeof(remote_str), "%s", ((struct sockaddr_un *)remote)->sun_path); |
|---|
| 446 | 444 | break; |
|---|
| r3b79719 |
rc6a5f68 |
|
| 576 | 576 | break; |
|---|
| 577 | 577 | case AF_UNIX: |
|---|
| 578 | | len = SUN_LEN(&(nctx->r.remote_un)); |
|---|
| 579 | 578 | snprintf(remote_str, sizeof(remote_str), "%s", nctx->r.remote_un.sun_path); |
|---|
| 580 | 579 | break; |
|---|
| r77c2f1d |
rc6a5f68 |
|
| 174 | 174 | |
|---|
| 175 | 175 | static int child_main() { |
|---|
| 176 | | int lockfd; |
|---|
| 177 | 176 | char lockfile[PATH_MAX]; |
|---|
| 178 | 177 | char conf_str[1024]; |
|---|
| … | … | |
| 195 | 194 | * If not we will daemon and must reacquire the lock. |
|---|
| 196 | 195 | */ |
|---|
| 197 | | lockfd = -1; |
|---|
| 198 | 196 | lockfile[0] = '\0'; |
|---|
| 199 | 197 | if(noit_conf_get_stringbuf(NULL, "/" APPNAME "/@lockfile", |
|---|
| 200 | 198 | lockfile, sizeof(lockfile))) { |
|---|
| 201 | | if((lockfd = noit_lockfile_acquire(lockfile)) < 0) { |
|---|
| | 199 | if(noit_lockfile_acquire(lockfile) < 0) { |
|---|
| 202 | 200 | noitL(noit_stderr, "Failed to acquire lock: %s\n", lockfile); |
|---|
| 203 | 201 | exit(-1); |
|---|