summaryrefslogtreecommitdiff
path: root/lib-src/pop.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-04-29 15:46:17 +0000
committerRichard M. Stallman <rms@gnu.org>1996-04-29 15:46:17 +0000
commit29e66fae16aa18bd088f0b7d4f026515b3e952e3 (patch)
tree5273ed6e6f489c3032304468a6335b1a763aaf77 /lib-src/pop.c
parent6c2721203a305bbcb6b12a64484bbc4edcff57c4 (diff)
downloademacs-29e66fae16aa18bd088f0b7d4f026515b3e952e3.tar.gz
(SEND, RECV): Renamed from send, recv.
(pop_open, pop_trash): Make the trash_started code unconditional. (socket_connection): Delete casts to void.
Diffstat (limited to 'lib-src/pop.c')
-rw-r--r--lib-src/pop.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib-src/pop.c b/lib-src/pop.c
index ac67abd08b1..4bd1d98beba 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -41,12 +41,15 @@ Boston, MA 02111-1307, USA. */
#include "ntlib.h"
#include <winsock.h>
#undef SOCKET_ERROR
+#define RECV(s,buf,len,flags) recv(s,buf,len,flags)
+#define SEND(s,buf,len,flags) send(s,buf,len,flags)
+#define CLOSESOCKET(s) closesocket(s)
#else
#include <netinet/in.h>
#include <sys/socket.h>
-#define recv(s,buf,len,flags) read(s,buf,len)
-#define send(s,buf,len,flags) write(s,buf,len)
-#define closesocket close
+#define RECV(s,buf,len,flags) read(s,buf,len)
+#define SEND(s,buf,len,flags) write(s,buf,len)
+#define CLOSESOCKET(s) close(s)
#endif
#include <pop.h>
@@ -1084,7 +1087,7 @@ socket_connection (host, flags)
if (! *hostent->h_addr_list)
{
- (void) closesocket (sock);
+ CLOSESOCKET (sock);
strcpy (pop_error, CONNECT_ERROR);
strncat (pop_error, strerror (errno),
ERROR_MAX - sizeof (CONNECT_ERROR));
@@ -1105,7 +1108,7 @@ socket_connection (host, flags)
strcpy (pop_error, KRB_ERROR);
strncat (pop_error, error_message (rem),
ERROR_MAX - sizeof(KRB_ERROR));
- (void) closesocket (sock);
+ CLOSESOCKET (sock);
return (-1);
}
@@ -1162,7 +1165,7 @@ socket_connection (host, flags)
if (err_ret)
krb5_free_error (err_ret);
- (void) closesocket (sock);
+ CLOSESOCKET (sock);
return (-1);
}
#else /* ! KRB5 */
@@ -1179,7 +1182,7 @@ socket_connection (host, flags)
strcpy (pop_error, KRB_ERROR);
strncat (pop_error, krb_err_txt[rem],
ERROR_MAX - sizeof (KRB_ERROR));
- (void) closesocket (sock);
+ CLOSESOCKET (sock);
return (-1);
}
#endif /* KRB5 */
@@ -1271,7 +1274,7 @@ getline (server)
return (0);
}
}
- ret = recv (server->file, server->buffer + server->data,
+ ret = RECV (server->file, server->buffer + server->data,
server->buffer_size - server->data - 1, 0);
if (ret < 0)
{
@@ -1377,7 +1380,7 @@ fullwrite (fd, buf, nbytes)
int ret;
cp = buf;
- while ((ret = send (fd, cp, nbytes, 0)) > 0)
+ while ((ret = SEND (fd, cp, nbytes, 0)) > 0)
{
cp += ret;
nbytes -= ret;
@@ -1496,16 +1499,15 @@ pop_trash (server)
{
if (server->file >= 0)
{
-#ifdef WINDOWSNT
/* avoid recursion; sendline can call pop_trash */
if (server->trash_started)
return;
server->trash_started = 1;
-#endif
+
sendline (server, "RSET");
sendline (server, "QUIT");
- closesocket (server->file);
+ CLOSESOCKET (server->file);
server->file = -1;
if (server->buffer)
{