Skip to content

Commit

Permalink
exec: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent f45726e commit 41cd7a2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
18 changes: 9 additions & 9 deletions src/modules/exec/exec.c
Expand Up @@ -156,8 +156,8 @@ int exec_str(struct sip_msg *msg, char *cmd, char *param, int param_len)
/* trim from right */
while(uri.len
&& (uri.s[uri.len - 1] == '\r' || uri.s[uri.len - 1] == '\n'
|| uri.s[uri.len - 1] == '\t'
|| uri.s[uri.len - 1] == ' ')) {
|| uri.s[uri.len - 1] == '\t'
|| uri.s[uri.len - 1] == ' ')) {
LM_DBG("rtrim\n");
uri.len--;
}
Expand Down Expand Up @@ -248,8 +248,8 @@ int exec_avp(struct sip_msg *msg, char *cmd, pvname_list_p avpl)
/* trim from right */
while(res.len
&& (res.s[res.len - 1] == '\r' || res.s[res.len - 1] == '\n'
|| res.s[res.len - 1] == '\t'
|| res.s[res.len - 1] == ' ')) {
|| res.s[res.len - 1] == '\t'
|| res.s[res.len - 1] == ' ')) {
res.len--;
}
/* skip empty line */
Expand Down Expand Up @@ -328,15 +328,15 @@ int exec_cmd(sip_msg_t *msg, char *cmd)
/* return false if script exited with non-zero status */
if(WEXITSTATUS(exit_status) != 0) {
LM_DBG("cmd %s with non-zero status - exit_status=%d,"
" wexitstatus: %d, errno=%d: %s\n",
cmd, exit_status, WEXITSTATUS(exit_status),
errno, strerror(errno));
" wexitstatus: %d, errno=%d: %s\n",
cmd, exit_status, WEXITSTATUS(exit_status), errno,
strerror(errno));
ret = -1;
}
} else { /* exited erroneously */
LM_ERR("cmd %s failed. exit_status=%d, wexitstatus: %d, errno=%d: %s\n",
cmd, exit_status, WEXITSTATUS(exit_status),
errno, strerror(errno));
cmd, exit_status, WEXITSTATUS(exit_status), errno,
strerror(errno));
ret = -1;
}

Expand Down
15 changes: 8 additions & 7 deletions src/modules/exec/exec_hf.c
Expand Up @@ -79,8 +79,8 @@ static int insert_hf(struct hf_wrapper **list, struct hdr_field *hf)
if(hf->type == HDR_OTHER_T
&& (hf->name.len != i->u.hf->name.len
|| strncasecmp(i->u.hf->name.s, hf->name.s,
hf->name.len)
!= 0))
hf->name.len)
!= 0))
continue;
/* yes, we found a hf of same type */
w->next_same = i->next_same;
Expand Down Expand Up @@ -472,7 +472,7 @@ static int append_fixed_vars(struct sip_msg *msg, struct hf_wrapper **list)
}
/* request URI */
uri = msg->new_uri.s && msg->new_uri.len ? &msg->new_uri
: &msg->first_line.u.request.uri;
: &msg->first_line.u.request.uri;
if(!append_var(EV_RURI, uri->s, uri->len, list)) {
LM_ERR("append_var URI failed\n");
return 0;
Expand All @@ -488,19 +488,20 @@ static int append_fixed_vars(struct sip_msg *msg, struct hf_wrapper **list)
}
/* original URI */
if(!append_var(EV_ORURI, msg->first_line.u.request.uri.s,
msg->first_line.u.request.uri.len, list)) {
msg->first_line.u.request.uri.len, list)) {
LM_ERR("append_var O-URI failed\n");
goto error;
}
/* userpart of request URI */
if(parse_uri(msg->first_line.u.request.uri.s,
msg->first_line.u.request.uri.len, &oparsed_uri) < 0) {
msg->first_line.u.request.uri.len, &oparsed_uri)
< 0) {
LM_WARN("orig URI not parsed (%.*s)\n",
msg->first_line.u.request.uri.len,
ZSW( msg->first_line.u.request.uri.s));
ZSW(msg->first_line.u.request.uri.s));
} else {
if(!append_var(
EV_OUSER, oparsed_uri.user.s, oparsed_uri.user.len, list)) {
EV_OUSER, oparsed_uri.user.s, oparsed_uri.user.len, list)) {
LM_ERR("append_var OUSER failed\n");
goto error;
}
Expand Down

0 comments on commit 41cd7a2

Please sign in to comment.