diff --git a/src/modules/flow/test/boolean-generator.c b/src/modules/flow/test/boolean-generator.c index 1f3326558..79c1679e4 100644 --- a/src/modules/flow/test/boolean-generator.c +++ b/src/modules/flow/test/boolean-generator.c @@ -78,7 +78,7 @@ boolean_generator_open( if (opts->sequence == NULL || *opts->sequence == '\0') { SOL_ERR("Option 'sequence' is either NULL or empty."); - return -1; + return -EINVAL; } mdata->it = mdata->sequence = strdup(opts->sequence); diff --git a/src/modules/flow/test/float-generator.c b/src/modules/flow/test/float-generator.c index fde044461..6faf78cd3 100644 --- a/src/modules/flow/test/float-generator.c +++ b/src/modules/flow/test/float-generator.c @@ -95,7 +95,7 @@ float_generator_open( } if (it == tail) { SOL_WRN("Failed to convert option 'sequence' to int %s", it); - errno = -EINVAL; + errno = EINVAL; goto error; } it = tail; @@ -107,10 +107,10 @@ float_generator_open( return 0; no_memory: - errno = -ENOMEM; + errno = ENOMEM; error: sol_vector_clear(&mdata->values); - return errno; + return -errno; } void diff --git a/src/modules/flow/test/float-validator.c b/src/modules/flow/test/float-validator.c index 83a608883..63935071e 100644 --- a/src/modules/flow/test/float-validator.c +++ b/src/modules/flow/test/float-validator.c @@ -75,7 +75,7 @@ float_validator_open( } if (it == tail) { SOL_WRN("Failed to convert option 'sequence' to double %s", it); - errno = -EINVAL; + errno = EINVAL; goto error; } it = tail; @@ -84,10 +84,10 @@ float_validator_open( return 0; no_memory: - errno = -ENOMEM; + errno = ENOMEM; error: sol_vector_clear(&mdata->values); - return errno; + return -errno; } int diff --git a/src/modules/flow/test/int-generator.c b/src/modules/flow/test/int-generator.c index 878a30b1d..33a1ae9c5 100644 --- a/src/modules/flow/test/int-generator.c +++ b/src/modules/flow/test/int-generator.c @@ -98,7 +98,7 @@ int_generator_open( } if (it == tail) { SOL_WRN("Failed to convert option 'sequence' to int %s", it); - errno = -EINVAL; + errno = EINVAL; goto error; } it = tail; @@ -110,10 +110,10 @@ int_generator_open( return 0; no_memory: - errno = -ENOMEM; + errno = ENOMEM; error: sol_vector_clear(&mdata->values); - return errno; + return -errno; } void