| 43 | static int fsmonitor__announce_startup = 0; |
| 44 | |
| 45 | static int fsmonitor_config(const char *var, const char *value, |
| 46 | const struct config_context *ctx, void *cb) |
| 47 | { |
| 48 | if (!strcmp(var, FSMONITOR__IPC_THREADS)) { |
| 49 | int i = git_config_int(var, value, ctx->kvi); |
| 50 | if (i < 1) |
| 51 | return error(_("value of '%s' out of range: %d"), |
| 52 | FSMONITOR__IPC_THREADS, i); |
| 53 | fsmonitor__ipc_threads = i; |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | if (!strcmp(var, FSMONITOR__START_TIMEOUT)) { |
| 58 | int i = git_config_int(var, value, ctx->kvi); |
| 59 | if (i < 0) |
| 60 | return error(_("value of '%s' out of range: %d"), |
| 61 | FSMONITOR__START_TIMEOUT, i); |
| 62 | fsmonitor__start_timeout_sec = i; |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | if (!strcmp(var, FSMONITOR__ANNOUNCE_STARTUP)) { |
| 67 | int is_bool; |
| 68 | int i = git_config_bool_or_int(var, value, ctx->kvi, &is_bool); |
| 69 | if (i < 0) |
| 70 | return error(_("value of '%s' not bool or int: %d"), |
| 71 | var, i); |
| 72 | fsmonitor__announce_startup = i; |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | return git_default_config(var, value, ctx, cb); |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | * Acting as a CLIENT. |
nothing calls this directly
no test coverage detected