diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2013-12-24 11:41:04 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2013-12-24 11:41:04 +0100 |
commit | 96debedcc8747de0bb797366bed34760a9c6ba58 (patch) | |
tree | 268b66fca24c2bc61d6ca5943fe6fe34b91f9427 | |
parent | 8dda05e0011f9db63ad21ed2d1b74e7bdde58902 (diff) | |
download | px4-firmware-96debedcc8747de0bb797366bed34760a9c6ba58.tar.gz px4-firmware-96debedcc8747de0bb797366bed34760a9c6ba58.tar.bz2 px4-firmware-96debedcc8747de0bb797366bed34760a9c6ba58.zip |
prevent dataman from blocking startup when no sd card is present
-rw-r--r-- | src/modules/dataman/dataman.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/dataman/dataman.c b/src/modules/dataman/dataman.c index 874a47be7..14112fc0d 100644 --- a/src/modules/dataman/dataman.c +++ b/src/modules/dataman/dataman.c @@ -572,11 +572,13 @@ task_main(int argc, char *argv[]) g_task_fd = open(k_data_manager_device_path, O_RDWR | O_CREAT | O_BINARY); if (g_task_fd < 0) { warnx("Could not open data manager file %s", k_data_manager_device_path); + sem_post(&g_init_sema); return -1; } if (lseek(g_task_fd, max_offset, SEEK_SET) != max_offset) { close(g_task_fd); warnx("Could not seek data manager file %s", k_data_manager_device_path); + sem_post(&g_init_sema); return -1; } fsync(g_task_fd); @@ -720,7 +722,7 @@ dataman_main(int argc, char *argv[]) if (g_fd < 0) errx(1, "start failed"); - return 0; + exit(0); } if (g_fd < 0) @@ -733,6 +735,6 @@ dataman_main(int argc, char *argv[]) else usage(); - return 0; + exit(1); } |