~phablet-team/libdsme/master

« back to all changes in this revision

Viewing changes to include/dsme/messages.h

  • Committer: Simo Piiroinen
  • Date: 2018-03-29 09:34:56 UTC
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: git-v1:b661f44ee87b1a6df8658d229d71adefc930839e
[protocol] Set errno when abandoning dsmesock_send_with_extra()

Callers expect errno to be set when dsmesock_send_with_extra() - which
does not happen on error paths that bypass io altogether.

Set errno to ENOTCONN when doing early return due to invalid connection
state.

Also remove redundant parentheses.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
#define DSMEMSG_CAST(T, M)                                       \
80
80
 ((((const dsmemsg_generic_t*)(M))->size_ == sizeof(T)) ?        \
81
81
    (((const dsmemsg_generic_t*)(M))->type_ == DSME_MSG_ID_(T) ? \
82
 
      (T*)(M) : 0) : 0) 
 
82
      (T*)(M) : 0) : 0)
83
83
 
84
84
 
85
85
/**
86
86
 * @defgroup message_if Message passing interface for modules
87
87
 * In addition to these functions, dsmesock_send() can be used from modules.
88
 
 */     
 
88
 */
89
89
 
90
90
#define DSMEMSG_PRIVATE_FIELDS \
91
91
  u_int32_t line_size_;        \