diff --git a/howdy/src/pam/main.cc b/howdy/src/pam/main.cc index 68501b4..3662b62 100644 --- a/howdy/src/pam/main.cc +++ b/howdy/src/pam/main.cc @@ -79,6 +79,9 @@ auto howdy_error(int status, conv_function(PAM_ERROR_MSG, S("Face detection image too dark")); syslog(LOG_ERR, "Failure, image too dark"); break; + case CompareError::INVALID_DEVICE: + syslog(LOG_ERR, "Failure, not possible to open camera at configured path"); + break; default: conv_function(PAM_ERROR_MSG, std::string(S("Unknown error: ") + status).c_str()); diff --git a/howdy/src/pam/main.hh b/howdy/src/pam/main.hh index 5b5dcf8..12f687d 100644 --- a/howdy/src/pam/main.hh +++ b/howdy/src/pam/main.hh @@ -13,7 +13,8 @@ enum CompareError : int { TIMEOUT_REACHED = 11, ABORT = 12, TOO_DARK = 13, - TIMEOUT_ACTIVE = 2816, + INVALID_DEVICE = 14, + TIMEOUT_ACTIVE = 2816 }; inline auto get_workaround(const std::string &workaround) -> Workaround { diff --git a/howdy/src/pam/optional_task.hh b/howdy/src/pam/optional_task.hh index b439628..39b60a4 100644 --- a/howdy/src/pam/optional_task.hh +++ b/howdy/src/pam/optional_task.hh @@ -27,7 +27,7 @@ public: template optional_task::optional_task(std::function func) : task(std::packaged_task(std::move(func))), future(task.get_future()), - spawned(false), is_active(false) {} + spawned(), is_active() {} // Create a new thread and launch the task on it. template void optional_task::activate() { diff --git a/howdy/src/recorders/video_capture.py b/howdy/src/recorders/video_capture.py index 50032ad..2c55c57 100644 --- a/howdy/src/recorders/video_capture.py +++ b/howdy/src/recorders/video_capture.py @@ -37,7 +37,7 @@ class VideoCapture: print(_("Howdy could not find a camera device at the path specified in the config file.")) print(_("It is very likely that the path is not configured correctly, please edit the 'device_path' config value by running:")) print("\n\tsudo howdy config\n") - sys.exit(1) + sys.exit(14) # Create reader # The internal video recorder @@ -83,7 +83,7 @@ class VideoCapture: ret, frame = self.internal.read() if not ret: print(_("Failed to read camera specified in the 'device_path' config option, aborting")) - sys.exit(1) + sys.exit(14) try: # Convert from color to grayscale