Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace exit with return in zephyr examples #774

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/zephyr/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int main(int argc, char **argv) {
z_owned_session_t s;
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
return -1;
}
printf("OK\n");

Expand All @@ -92,7 +92,7 @@ int main(int argc, char **argv) {
z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR);
if (z_get(z_loan(s), z_loan(ke), "", z_move(callback), &opts) < 0) {
printf("Unable to send query.\n");
exit(-1);
return -1;
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/zephyr/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main(int argc, char **argv) {
z_owned_session_t s;
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
return -1;
}
printf("OK\n");

Expand All @@ -62,7 +62,7 @@ int main(int argc, char **argv) {
z_owned_publisher_t pub;
if (z_declare_publisher(z_loan(s), &pub, z_loan(ke), NULL) < 0) {
printf("Unable to declare publisher for key expression!\n");
exit(-1);
return -1;
}
printf("OK\n");

Expand Down
6 changes: 3 additions & 3 deletions examples/zephyr/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ int main(int argc, char **argv) {
z_owned_session_t s;
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
return -1;
}
printf("OK\n");

// Start read and lease tasks for zenoh-pico
if (zp_start_read_task(z_loan_mut(s), NULL) < 0 || zp_start_lease_task(z_loan_mut(s), NULL) < 0) {
printf("Unable to start read and lease tasks\n");
z_session_drop(z_session_move(&s));
exit(-1);
return -1;
}

printf("Declaring Subscriber on '%s'...\n", KEYEXPR);
Expand All @@ -68,7 +68,7 @@ int main(int argc, char **argv) {
z_view_keyexpr_from_str(&ke, KEYEXPR);
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(closure), NULL) < 0) {
printf("Unable to declare subscriber.\n");
exit(-1);
return -1;
}

printf("Pulling data every %zu ms... Ring size: %zd\n", INTERVAL, SIZE);
Expand Down
4 changes: 2 additions & 2 deletions examples/zephyr/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int main(int argc, char **argv) {
z_owned_session_t s;
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
return -1;
}
printf("OK\n");

Expand All @@ -88,7 +88,7 @@ int main(int argc, char **argv) {
z_view_keyexpr_from_str_unchecked(&ke, KEYEXPR);
if (z_declare_queryable(z_loan(s), &qable, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare queryable.\n");
exit(-1);
return -1;
}
printf("OK\n");
printf("Zenoh setup finished!\n");
Expand Down
4 changes: 2 additions & 2 deletions examples/zephyr/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char **argv) {
z_owned_session_t s;
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
return -1;
}
printf("OK\n");

Expand All @@ -71,7 +71,7 @@ int main(int argc, char **argv) {
z_owned_subscriber_t sub;
if (z_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare subscriber.\n");
exit(-1);
return -1;
}
printf("OK!\n");

Expand Down
Loading