From: Richard M. Stallman Date: Mon, 29 Apr 1996 15:46:17 +0000 (+0000) Subject: (SEND, RECV): Renamed from send, recv. X-Git-Tag: emacs-19.34~753 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=de5c39cffd4216f21db580e89bb04ea412ecc66e;p=emacs.git (SEND, RECV): Renamed from send, recv. (pop_open, pop_trash): Make the trash_started code unconditional. (socket_connection): Delete casts to void. --- 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 #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 #include -#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 @@ -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) {