Changeset 000581aaa029b35ddf2cf5f65f70c943df0cb405
- Timestamp:
- 12/21/10 22:59:31
(2 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1292972371 +0000
- git-parent:
[7fbea6436b3d271e41e913291bb1bd2f606358e3]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1292972371 +0000
- Message:
set the fd to -1 after close and update the console output, refs #333
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r7fbea64 |
r000581a |
|
| 314 | 314 | if(ts->refcnt == 0 && ts->sess_handle) { |
|---|
| 315 | 315 | eventer_remove_fd(ts->fd); |
|---|
| | 316 | ts->fd = -1; |
|---|
| 316 | 317 | if(ts->timeoutevent) { |
|---|
| 317 | 318 | eventer_remove(ts->timeoutevent); |
|---|
| … | … | |
| 1009 | 1010 | nc_printf_snmpts_brief(noit_console_closure_t ncct, |
|---|
| 1010 | 1011 | struct target_session *ts) { |
|---|
| | 1012 | char fd[32]; |
|---|
| 1011 | 1013 | struct timeval now, diff; |
|---|
| 1012 | 1014 | gettimeofday(&now, NULL); |
|---|
| 1013 | 1015 | sub_timeval(now, ts->last_open, &diff); |
|---|
| 1014 | | nc_printf(ncct, "[%s]\n\topened: %0.3fs ago\n\tFD: %d\n\trefcnt: %d\n", |
|---|
| | 1016 | if(ts->fd < 0) |
|---|
| | 1017 | snprintf(fd, sizeof(fd), "%s", "(closed)"); |
|---|
| | 1018 | else |
|---|
| | 1019 | snprintf(fd, sizeof(fd), "%d", ts->fd); |
|---|
| | 1020 | nc_printf(ncct, "[%s]\n\topened: %0.3fs ago\n\tFD: %s\n\trefcnt: %d\n", |
|---|
| 1015 | 1021 | ts->target, diff.tv_sec + (float)diff.tv_usec/1000000, |
|---|
| 1016 | | ts->fd, ts->refcnt); |
|---|
| | 1022 | fd, ts->refcnt); |
|---|
| 1017 | 1023 | } |
|---|
| 1018 | 1024 | |
|---|