Skip to content

Commit

Permalink
mx_mysql: Reset errno if changed during statement_close
Browse files Browse the repository at this point in the history
partly fixes issue mariux64#18
  • Loading branch information
mariux committed Aug 10, 2015
1 parent 23fc503 commit 22ef3dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mx_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ int mx_mysql_do_statement(struct mx_mysql *mysql, char *query, struct mx_mysql_b
if (res < 0) {
mx_log_err("mx_mysql_statement_execute(): %m");
mx_mysql_statement_close(&stmt);
return res;
return -(errno=-res);
}

if (result && result->count && num_rows) {
Expand All @@ -1359,7 +1359,7 @@ int mx_mysql_do_statement(struct mx_mysql *mysql, char *query, struct mx_mysql_b
mx_log_err("mx_mysql_statement_fetch(): %m");
mx_free_null(tmpdata);
mx_mysql_statement_close(&stmt);
return res;
return -(errno=-res);
}
memcpy(tmpdata+(cnt*size), from, size);
}
Expand Down

0 comments on commit 22ef3dd

Please sign in to comment.