summaryrefslogtreecommitdiff
path: root/common/spio.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-09-04 00:16:11 +0000
committerStef Walter <stef@memberwebs.com>2004-09-04 00:16:11 +0000
commit86e6b10005f11d4cb97e2a836f849a99f0fe07ed (patch)
tree0d9c05bf6aaa659a972b3809d2ad223c9f9b5461 /common/spio.c
parentfdafaaeec8b05ab1e62457ecb6202ced98caa202 (diff)
Make g_state a readonly pointer.
Diffstat (limited to 'common/spio.c')
-rw-r--r--common/spio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/spio.c b/common/spio.c
index b4c9cb8..dab1e5a 100644
--- a/common/spio.c
+++ b/common/spio.c
@@ -116,8 +116,8 @@ int clio_connect(clamsmtp_context_t* ctx, clio_t* io, struct sockaddr_any* sany,
if((io->fd = socket(SANY_TYPE(*sany), SOCK_STREAM, 0)) == -1)
RETURN(-1);
- if(setsockopt(io->fd, SOL_SOCKET, SO_RCVTIMEO, &g_state.timeout, sizeof(g_state.timeout)) == -1 ||
- setsockopt(io->fd, SOL_SOCKET, SO_SNDTIMEO, &g_state.timeout, sizeof(g_state.timeout)) == -1)
+ if(setsockopt(io->fd, SOL_SOCKET, SO_RCVTIMEO, &(g_state->timeout), sizeof(g_state->timeout)) == -1 ||
+ setsockopt(io->fd, SOL_SOCKET, SO_SNDTIMEO, &(g_state->timeout), sizeof(g_state->timeout)) == -1)
messagex(ctx, LOG_WARNING, "couldn't set timeouts on connection");
if(connect(io->fd, &SANY_ADDR(*sany), SANY_LEN(*sany)) == -1)
@@ -183,7 +183,7 @@ int clio_select(clamsmtp_context_t* ctx, clio_t** io)
/* Select on the above */
- switch(select(FD_SETSIZE, &mask, NULL, NULL, &g_state.timeout))
+ switch(select(FD_SETSIZE, &mask, NULL, NULL, &(g_state->timeout)))
{
case 0:
messagex(ctx, LOG_ERR, "network operation timed out");
@@ -244,7 +244,7 @@ int clio_read_line(clamsmtp_context_t* ctx, clio_t* io, int opts)
if(errno == EINTR)
{
/* When the application is quiting */
- if(g_state.quit)
+ if(g_state->quit)
return -1;
/* For any other signal we go again */
@@ -380,7 +380,7 @@ int clio_write_data_raw(clamsmtp_context_t* ctx, clio_t* io, unsigned char* buf,
if(errno == EINTR)
{
/* When the application is quiting */
- if(g_state.quit)
+ if(g_state->quit)
return -1;
/* For any other signal we go again */