diff options
author | David Robillard <d@drobilla.net> | 2024-09-29 19:27:35 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-10-12 14:07:10 -0400 |
commit | dd4fb898df782cb5825eb25d64d0198226b5e7b0 (patch) | |
tree | 7eef44285825142cdddf53361a09cecef1a4847e /src/jack.c | |
parent | ae5087095b0adb5020708025837108656039903f (diff) | |
download | jalv-dd4fb898df782cb5825eb25d64d0198226b5e7b0.tar.gz jalv-dd4fb898df782cb5825eb25d64d0198226b5e7b0.tar.bz2 jalv-dd4fb898df782cb5825eb25d64d0198226b5e7b0.zip |
Return distinct error codes from jack_initialize()
Diffstat (limited to 'src/jack.c')
-rw-r--r-- | src/jack.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -475,20 +475,27 @@ jalv_backend_activate_port(Jalv* jalv, uint32_t port_index) int jack_initialize(jack_client_t* const client, const char* const load_init) { +#ifndef E2BIG +# define E2BIG 7 +#endif +#ifndef ENOMEM +# define ENOMEM 12 +#endif + const size_t args_len = strlen(load_init); if (args_len > JACK_LOAD_INIT_LIMIT) { jalv_log(JALV_LOG_ERR, "Too many arguments given\n"); - return -1; + return E2BIG; } Jalv* const jalv = (Jalv*)calloc(1, sizeof(Jalv)); if (!jalv) { - return -1; + return ENOMEM; } if (!(jalv->backend = (JalvBackend*)calloc(1, sizeof(JalvBackend)))) { free(jalv); - return -1; + return ENOMEM; } jalv->backend->client = client; @@ -522,6 +529,9 @@ jack_initialize(jack_client_t* const client, const char* const load_init) free(argv); free(cmd); return err; + +#undef ENOMEM +#undef E2BIG } void |