From: Unknown <> Date: Sat, 23 Jul 2011 00:20:11 +0000 (+0000) Subject: add files for 2011-07-23T00:20:11Z X-Git-Tag: imap-2007f~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65f0c49787aff89270cc4dfa3f8b424f0a92e6d9;p=uw-imap add files for 2011-07-23T00:20:11Z --- diff --git a/src/osdep/unix/os_a52.c b/src/osdep/unix/os_a52.c new file mode 100644 index 0000000..fed6af7 --- /dev/null +++ b/src/osdep/unix/os_a52.c @@ -0,0 +1,63 @@ +/* ======================================================================== + * Copyright 1988-2006 University of Washington + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * + * ======================================================================== + */ + +/* + * Program: Operating-system dependent routines -- AIX 4.1 on RS 6000 + * + * Author: Mark Crispin + * Networks and Distributed Computing + * Computing & Communications + * University of Washington + * Administration Building, AG-44 + * Seattle, WA 98195 + * Internet: MRC@CAC.Washington.EDU + * + * Date: 1 August 1988 + * Last Edited: 30 August 2006 + */ + +#include "tcp_unix.h" /* must be before osdep includes tcp.h */ +#include "mail.h" +#include "osdep.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +extern int errno; /* just in case */ +#include +#include "misc.h" +#include +#include /* needed for authenticate() */ + +int authenticate (char *UserName,char *Response,int *Reenter,char **Message); + +extern int sys_nerr; +extern char *sys_errlist[]; + + +#include "fs_unix.c" +#include "ftl_unix.c" +#include "nl_unix.c" +#include "env_unix.c" +#include "tcp_unix.c" +#include "gr_waitp.c" +#include "tz_sv4.c" +#include "flocksim.c" +#undef setpgrp +#include "setpgrp.c" +#include "utime.c" diff --git a/src/osdep/unix/os_a52.h b/src/osdep/unix/os_a52.h new file mode 100644 index 0000000..a826174 --- /dev/null +++ b/src/osdep/unix/os_a52.h @@ -0,0 +1,53 @@ +/* ======================================================================== + * Copyright 1988-2006 University of Washington + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * + * ======================================================================== + */ + +/* + * Program: Operating-system dependent routines -- AIX on RS6000 + * + * Author: Mark Crispin + * Networks and Distributed Computing + * Computing & Communications + * University of Washington + * Administration Building, AG-44 + * Seattle, WA 98195 + * Internet: MRC@CAC.Washington.EDU + * + * Date: 1 August 1988 + * Last Edited: 30 August 2006 + */ + +#include +#include +#include +#include +#include /* for struct tm */ +#include +#include +#include +#include +#include +#include + + +#define setpgrp(a,b) Setpgrp(a,b) +int Setpgrp (int pid,int gid); + +#define utime portable_utime +int portable_utime (char *file,time_t timep[2]); + +#include "env_unix.h" +#include "fs.h" +#include "ftl.h" +#include "nl.h" +#include "tcp.h" +#include "flocksim.h" diff --git a/src/osdep/unix/tcp_unix.c b/src/osdep/unix/tcp_unix.c index 818eb9a..2d834c2 100644 --- a/src/osdep/unix/tcp_unix.c +++ b/src/osdep/unix/tcp_unix.c @@ -239,7 +239,7 @@ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port, size_t len; time_t now; struct protoent *pt = getprotobyname ("tcp"); - fd_set fds,efds; + fd_set rfds,wfds,efds; struct timeval tmo; struct sockaddr *sadr = ip_sockaddr (family,adr,adrlen,port,&len); blocknotify_t bn = (blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL); @@ -285,13 +285,15 @@ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port, now = time (0); /* open timeout */ ti = ttmo_open ? now + ttmo_open : 0; tmo.tv_usec = 0; - FD_ZERO (&fds); /* initialize selection vector */ + FD_ZERO (&rfds); /* initialize selection vector */ + FD_ZERO (&wfds); /* initialize selection vector */ FD_ZERO (&efds); /* handle errors too */ - FD_SET (sock,&fds); /* block for error or readable */ + FD_SET (sock,&rfds); /* block for error or readable or writable */ + FD_SET (sock,&wfds); FD_SET (sock,&efds); do { /* block under timeout */ tmo.tv_sec = ti ? ti - now : 0; - i = select (sock+1,&fds,NIL,&efds,ti ? &tmo : NIL); + i = select (sock+1,&rfds,&wfds,&efds,ti ? &tmo : NIL); now = time (0); /* fake timeout if interrupt & time expired */ if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0; } while ((i < 0) && (errno == EINTR)); @@ -300,7 +302,7 @@ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port, fcntl (sock,F_SETFL,flgs); /* This used to be a zero-byte read(), but that crashes Solaris */ /* get socket status */ - while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR)); + if(FD_ISSET(sock, &rfds)) while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR)); } if (i <= 0) { /* timeout or error? */ i = i ? errno : ETIMEDOUT;/* determine error code */