diff --git a/src/modules/vmount/vmount.cpp b/src/modules/vmount/vmount.cpp index aec55f4466..d70eee9d45 100644 --- a/src/modules/vmount/vmount.cpp +++ b/src/modules/vmount/vmount.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2013-2017 PX4 Development Team. All rights reserved. + * Copyright (c) 2013-2019 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -432,12 +432,21 @@ int vmount_main(int argc, char *argv[]) return -1; } - if (!strcmp(argv[1], "start") || !strcmp(argv[1], "test")) { + const bool found_start = !strcmp(argv[1], "start"); + const bool found_test = !strcmp(argv[1], "test"); + + if (found_start || found_test) { /* this is not an error */ if (thread_running) { - PX4_WARN("mount driver already running"); - return 0; + if (found_start) { + PX4_WARN("mount driver already running"); + return 0; + + } else { + PX4_WARN("mount driver already running, run vmount stop before 'vmount test'"); + return 1; + } } thread_should_exit = false;