]> granicus.if.org Git - uw-imap/commitdiff
add files for 2011-07-23T00:20:11Z
authorUnknown <>
Sat, 23 Jul 2011 00:20:11 +0000 (00:20 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Fri, 7 Sep 2018 00:09:58 +0000 (00:09 +0000)
src/osdep/unix/os_a52.c [new file with mode: 0644]
src/osdep/unix/os_a52.h [new file with mode: 0644]
src/osdep/unix/tcp_unix.c

diff --git a/src/osdep/unix/os_a52.c b/src/osdep/unix/os_a52.c
new file mode 100644 (file)
index 0000000..fed6af7
--- /dev/null
@@ -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
+ */
+\f 
+#include "tcp_unix.h"          /* must be before osdep includes tcp.h */
+#include "mail.h"
+#include "osdep.h"
+#include <stdio.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <ctype.h>
+#include <errno.h>
+extern int errno;              /* just in case */
+#include <pwd.h>
+#include "misc.h"
+#include <sys/select.h>
+#include <stddef.h>            /* 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 (file)
index 0000000..a826174
--- /dev/null
@@ -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
+ */
+\f
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <time.h>              /* for struct tm */
+#include <dirent.h>
+#include <fcntl.h>
+#include <utime.h>
+#include <syslog.h>
+#include <sys/file.h>
+#include <ustat.h>
+
+
+#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"
index 818eb9a0f35a2dd84087311ed3ccf05e09506cbc..2d834c27597b360702dbb458eec4d6753689236e 100644 (file)
@@ -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 */