
codesite-noreply at google
Feb 6, 2009, 5:54 AM
Post #21 of 23
(1059 views)
Permalink
|
|
Issue 347 in cherokee: Trivial compiler fixes bug
[In reply to]
|
|
Comment #20 on issue 347 by ste...@konink.de: Trivial compiler fixes bug http://code.google.com/p/cherokee/issues/detail?id=347 Might be good to also have these checks here. Index: validator_mysql.c =================================================================== --- validator_mysql.c (revision 2847) +++ validator_mysql.c (working copy) @@ -43,7 +43,9 @@ props_free (cherokee_validator_mysql_props_t *props) { cherokee_buffer_mrproper (&props->host); +#ifdef HAVE_SOCKADDR_UN cherokee_buffer_mrproper (&props->unix_socket); +#endif cherokee_buffer_mrproper (&props->user); cherokee_buffer_mrproper (&props->passwd); cherokee_buffer_mrproper (&props->database); @@ -67,7 +69,9 @@ cherokee_validator_props_init_base (VALIDATOR_PROPS (n), MODULE_PROPS_FREE(props_free)); cherokee_buffer_init (&n->host); - cherokee_buffer_init (&n->unix_socket); +#ifdef HAVE_SOCKADDR_UN + cherokee_buffer_init (&n->unix_socket); +#endif cherokee_buffer_init (&n->user); cherokee_buffer_init (&n->passwd); cherokee_buffer_init (&n->database); @@ -89,10 +93,10 @@ } else if (equal_buf_str (&subconf->key, "port")) { props->port = atoi (subconf->val.buf); - +#ifdef HAVE_SOCKADDR_UN } else if (equal_buf_str (&subconf->key, "unix_socket")) { cherokee_buffer_add_buffer (&props->unix_socket, &subconf->val); - +#endif } else if (equal_buf_str (&subconf->key, "user")) { cherokee_buffer_add_buffer (&props->user, &subconf->val); @@ -147,8 +151,11 @@ { MYSQL *conn; - if (unlikely ((props->host.buf == NULL) && - (props->unix_socket.buf == NULL))) { + if (unlikely ((props->host.buf == NULL) +#ifdef HAVE_SOCKADDR_UN + && (props->unix_socket.buf == NULL) +#endif + )) { PRINT_ERROR_S ("ERROR: MySQL validator misconfigured: A Host or Unix socket is needed."); return ret_error; } @@ -163,7 +170,12 @@ props->passwd.buf, props->database.buf, props->port, - props->unix_socket.buf, 0); +#ifdef HAVE_SOCKADDR_UN + props->unix_socket.buf, +#else + NULL, +#endif + 0); if (conn == NULL) { PRINT_ERROR ("Unable to connect to MySQL server: %s:%d %s\n", props->host.buf, props->port, mysql_error (mysql->conn)); Index: validator_mysql.h =================================================================== --- validator_mysql.h (revision 2847) +++ validator_mysql.h (working copy) @@ -39,8 +39,10 @@ cherokee_module_props_t base; cherokee_buffer_t host; - cint_t port; + cuint_t port; +#ifdef HAVE_SOCKADDR_UN cherokee_buffer_t unix_socket; +#endif cherokee_buffer_t user; cherokee_buffer_t passwd; -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings _______________________________________________ Cherokee-dev mailing list Cherokee-dev [at] lists http://lists.octality.com/listinfo/cherokee-dev
|