]> andersk Git - libfaim.git/commitdiff
- Sun Sep 3 23:58:17 UTC 2000
authormid <mid>
Mon, 4 Sep 2000 00:05:19 +0000 (00:05 +0000)
committermid <mid>
Mon, 4 Sep 2000 00:05:19 +0000 (00:05 +0000)
   - Portability fixes (for solaris, set the SOLARIS env var first)

CHANGES
Makefile
Makefile.rules
aim_rxqueue.c
aim_util.c
faim/aim.h
mkbuildinfo.sh
utils/aimdebugd/file.c
utils/faimtest/faimtest.c

diff --git a/CHANGES b/CHANGES
index 4b57c98e5003abed90acf91fdae04375d549c65a..e3e3c230bd07503ae68e31d091b6407e990ca2e4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
 
 No release numbers
 ------------------
+ - Sun Sep  3 23:58:17 UTC 2000
+   - Portability fixes (for solaris, set the SOLARIS env var first)
+
  - Sat Sep  2 23:42:37 UTC 2000
    - Hopefully fix aim_snac.c bugs
    - Add Buddy List Rights parser (max buddies and max watchers)
index 01f03f1f8b51f019f838493f32035e722309d6a4..326ededb184f271f6b052336735e3b63803f8595 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,11 @@ mkbuildinfo:
 libfaim: mkbuildinfo $(LIBFAIM_OBJECTS)
        $(AR) cru libfaim.a $(LIBFAIM_OBJECTS)
        $(RANLIB) libfaim.a
+ifdef SOLARIS
+       ld -G -o $(SONAME) $(LIBFAIM_OBJECTS) -lresolv
+else
        ld -o $(SONAME) $(LIBFAIM_OBJECTS) -shared -soname $(SONAME)
+endif
 
 allutils: libfaim
        @echo "LIBFAIM_INC = $$PWD" > utils/Makefile.dynamicrules; \
index 553e590f165dc2bf16ff3d0b5298f2c96fa52b9d..9b8980b0ee5ce97c3a4f6d38d04110d735efe0bb 100644 (file)
@@ -10,6 +10,11 @@ ifdef LIBFAIM_LIB
 LDFLAGS += -lfaim -L$(LIBFAIM_LIB)
 endif
 
+ifdef SOLARIS
+CC = gcc
+MAKE = gmake
+endif
+
 AR = ar
 RANLIB = ranlib
 
index 72f4481b392fb829feda20628cf9676ba0c5d65d..f362e3951401f882287138f977591753ef840f13 100644 (file)
@@ -8,6 +8,34 @@
 
 #include <faim/aim.h> 
 
+/*
+ * Since not all implementations support MSG_WAITALL, define
+ * an alternate guarenteed read function...
+ */
+static int aim_recv(int fd, void *buf, size_t count)
+{
+#ifdef FAIM_HAS_MSG_WAITALL
+  return recv(fd, buf, count, MSG_WAITALL);
+#else
+  int left, ret, cur = 0; 
+
+  left = count;
+
+  while (left) {
+    ret = read(fd, buf+cur, left);
+    if (ret == -1)
+      return -1;
+    if (ret == 0)
+      return cur;
+    
+    cur += ret;
+    left -= ret;
+  }
+
+  return cur;
+#endif
+}
+
 /*
  * Grab a single command sequence off the socket, and enqueue
  * it in the incoming event queue in a seperate struct.
@@ -41,7 +69,7 @@ int aim_get_command(struct aim_session_t *sess, struct aim_conn_t *conn)
    *   4 short -- Number of data bytes that follow.
    */
   faim_mutex_lock(&conn->active);
-  if (recv(conn->fd, generic, 6, MSG_WAITALL) < 6){
+  if (aim_recv(conn->fd, generic, 6) < 6){
     aim_conn_close(conn);
     faim_mutex_unlock(&conn->active);
     return -1;
@@ -89,7 +117,7 @@ int aim_get_command(struct aim_session_t *sess, struct aim_conn_t *conn)
   }
 
   /* read the data portion of the packet */
-  if (recv(conn->fd, newrx->data, newrx->commandlen, MSG_WAITALL) < newrx->commandlen){
+  if (aim_recv(conn->fd, newrx->data, newrx->commandlen) < newrx->commandlen){
     free(newrx->data);
     free(newrx);
     aim_conn_close(conn);
index 9bbf828a9c5d587d4053f1d7c176283fd3a1d929..77a3ba3982eb67e9dd47f0d94f31758241279a42 100644 (file)
@@ -227,3 +227,41 @@ int aim_sncmp(const char *sn1, const char *sn2)
 
   return 0;
 }
+
+/* strsep Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+   strsep is part of the GNU C Library.
+   
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+   
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+   
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+   Cambridge, MA 02139, USA.  */
+
+/* Minor changes by and1000 on 15/1/97 to make it go under Nemesis */
+
+char *aim_strsep(char **pp, const char *delim)
+{
+  char *p, *q;
+  
+  if (!(p = *pp))
+    return 0;
+  
+  if ((q = strpbrk (p, delim)))
+    {
+      *pp = q + 1;
+      *q = '\0';
+    }
+  else
+    *pp = 0;
+  
+  return p;
+}
index 0327561f5af802259936d8aaa90b791c3d718735..244c28b5c43d5480f9ee5f565fd5e9f1f830002d 100644 (file)
@@ -70,9 +70,8 @@
 #define gethostbyname(x) gethostbyname2(x, AF_INET) 
 #endif
 
-#if !defined(MSG_WAITALL)
-#warning FIX YOUR LIBC! MSG_WAITALL is required!
-#define MSG_WAITALL 0x100
+#if defined(MSG_WAITALL)
+#define FAIM_HAS_MSG_WAITALL
 #endif
 
 /* 
@@ -747,6 +746,9 @@ char *aimutil_itemidx(char *toSearch, int index, char dl);
 int aim_snlen(const char *sn);
 int aim_sncmp(const char *sn1, const char *sn2);
 
+/* for libc's that dont have it */
+char *aim_strsep(char **pp, const char *delim);
+
 /* aim_meta.c */
 char *aim_getbuilddate(void);
 char *aim_getbuildtime(void);
index 32357d7b7fdc8f128b084dd6f7020bdc4a64255d..075687d287e43d3ebe1ed98863b59f94e02751c2 100755 (executable)
@@ -1,10 +1,5 @@
 #!/bin/sh
 rm -rf aim_meta.o aim_buildcode.h
 
-echo -n "#define AIM_BUILDDATE \"" > aim_buildcode.h
-echo -n `date +%Y%m%d` >> aim_buildcode.h
-echo "\"" >> aim_buildcode.h
-
-echo -n "#define AIM_BUILDTIME \"" >> aim_buildcode.h
-echo -n `date +%H%M%S` >> aim_buildcode.h
-echo "\"" >> aim_buildcode.h
+echo "#define AIM_BUILDDATE \"`date +%Y%m%d`\"" > aim_buildcode.h
+echo "#define AIM_BUILDTIME \"`date +%H%M%S`\"" >> aim_buildcode.h
index a8e9867cbde6f1d4e9d5a73b15e2aa3568bba9b5..04069d175f21720a41b8b5abc3d3e8d603138280 100644 (file)
@@ -72,8 +72,8 @@ int parsescriptline2(struct aim_session_t *sess, struct aim_conn_t **scriptconn,
     {  
       char *sn, *msg;
       buf = nextwhite(buf)+1;
-      sn = strsep(&buf, "/");
-      msg = strsep(&buf, "/");
+      sn = aim_strsep(&buf, "/");
+      msg = aim_strsep(&buf, "/");
       sendimtoclient(sess, aim_getconn_type(sess, AIM_CONN_TYPE_BOS), sn, 0, msg);
     }
     break;
index a6e3cbf2c3ffd9568c1b332d8118b71de4851bb8..150ed3ed8e1553d65809b698274840d5c5431d9c 100644 (file)
@@ -657,7 +657,7 @@ int faimtest_parse_incoming_im(struct aim_session_t *sess, struct command_rx_str
        newconn = aim_directim_initiate(sess, command->conn, NULL, userinfo->sn);
        //aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINITIATE, faimtest_directim_initiate, 0);
       } else if (!strncmp(tmpstr, "reqsendmsg", 10)) {
-       aim_send_im(sess, command->conn, "vaxherder", 0, "sendmsg 7986");
+       aim_send_im(sess, command->conn, "vaxherder", 0, "sendmsg 7900");
       } else if (!strncmp(tmpstr, "sendmsg", 7)) {
        int i;
        i = atoi(tmpstr+8);
This page took 0.217304 seconds and 5 git commands to generate.