Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Commit

Permalink
Renamed error/2 due to name collision in libc
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Oct 8, 2013
1 parent 93d1992 commit c18aaa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions c_src/gen_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async(void *data) {
gd_trd_t *trd = ptr->trd_state;
if (trd[t].tid == 0 && (trd[t].tid = tid))
if ((trd[t].state = thread_init()) == NULL)
return error(ptr->res, GD_ERR_MEM);
return error_set(ptr->res, GD_ERR_MEM);

/* Select thread-specific state */
if (trd[t].tid == tid && (trd_state = trd[t].state))
Expand Down Expand Up @@ -157,7 +157,7 @@ ready(ErlDrvData drv_data, ErlDrvThreadData thread_data) {
/* Check, if we reached the end of the request buffer */
ei_decode_list_header(ptr->req->buf, &ptr->req->index, NULL);
if (!error_occurred(ptr->res) && ptr->req->len != ptr->req->index)
error(ptr->res, GD_ERR_DEC);
error_set(ptr->res, GD_ERR_DEC);

/* Check for error on synchronous request, output data */
if (ptr->req->syn) {
Expand Down Expand Up @@ -259,7 +259,7 @@ control(ErlDrvData drv_data, unsigned int cmd, char *buf,
* Set an error to be returned by the driver.
*/
void
error(gd_res_t *res, char *error) {
error_set(gd_res_t *res, char *error) {
strcpy(res->error, error);
res->error[strlen(error)] = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion c_src/gen_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ ErlDrvSSizeT control(ErlDrvData drv_data, unsigned int cmd, char *buf,
/**
* Helper functions to ease communication.
*/
void error(gd_res_t *res, char *error);
void error_set(gd_res_t *res, char *error);
int error_occurred(gd_res_t *res);

/* ----------------------------------------------------------------------------
Expand Down

0 comments on commit c18aaa7

Please sign in to comment.