Skip to content

libipc stealing the return value cramps my style #3

@mheily

Description

@mheily

It stinks that libipc forces the return of an 'int' that only has meaning to libipc. What if the IDL specified an "on_error" return value, and then just returned that if there was an error?
Instead of this:

int
echo(int *ret1, int arg1)
{
        *ret1 = arg1;
        return 0;
}

it would allow you to say this:

int
echo(int arg1)
{
        return arg1;
}

and the IDL could say that returning "-1" was the right thing to do if an error occurs.. something like:


---
service: com.example.myservice
domain: IPC_DOMAIN_USER
methods:
  echo:
    id: 1
    prototype: int echo(int request)
    on_error: -1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions