* Register the current directory as a Scalar enlistment, and set the * recommended configuration. * * * If 'maintenance' is non-zero, then enable background maintenance. * * If 'maintenance' is zero, then leave background maintenance as it is * currently configured. */
| 285 | * currently configured. |
| 286 | */ |
| 287 | static int register_dir(int maintenance) |
| 288 | { |
| 289 | if (add_or_remove_enlistment(1)) |
| 290 | return error(_("could not add enlistment")); |
| 291 | |
| 292 | if (set_recommended_config(0)) |
| 293 | return error(_("could not set recommended config")); |
| 294 | |
| 295 | if (maintenance && |
| 296 | toggle_maintenance(maintenance)) |
| 297 | warning(_("could not toggle maintenance")); |
| 298 | |
| 299 | if (have_fsmonitor_support() && start_fsmonitor_daemon()) { |
| 300 | return error(_("could not start the FSMonitor daemon")); |
| 301 | } |
| 302 | |
| 303 | return 0; |
| 304 | } |
| 305 | |
| 306 | static int unregister_dir(void) |
| 307 | { |
no test coverage detected