| 99 | } |
| 100 | |
| 101 | static int |
| 102 | statAdd(const char *name, TSRecordDataType record_type, TSMutex create_mutex) |
| 103 | { |
| 104 | int stat_id = -1; |
| 105 | |
| 106 | TSMutexLock(create_mutex); |
| 107 | |
| 108 | if (TS_ERROR == TSStatFindName(name, &stat_id)) { |
| 109 | stat_id = TSStatCreate(name, record_type, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 110 | if (stat_id == TS_ERROR) { |
| 111 | Dbg(dbg_ctl, "Error creating stat_name: %s", name); |
| 112 | } else { |
| 113 | Dbg(dbg_ctl, "Created stat_name: %s stat_id: %d", name, stat_id); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | TSMutexUnlock(create_mutex); |
| 118 | |
| 119 | return stat_id; |
| 120 | } |
| 121 | |
| 122 | static ssize_t |
| 123 | getFile(const char *filename, char *buffer, size_t bufferSize) |
no test coverage detected