View | Details | Raw Unified | Return to bug 70628
Collapse All | Expand All

(-)comms/gsmlib/Makefile (-12 / +6 lines)
Lines 15-25 Link Here
15
MAINTAINER=	ports@FreeBSD.org
15
MAINTAINER=	ports@FreeBSD.org
16
COMMENT=	A library to access GSM mobile phones through GSM modems
16
COMMENT=	A library to access GSM mobile phones through GSM modems
17
17
18
USE_GNOME=	gnometarget lthack
18
USE_GETOPT_LONG=	yes
19
USE_GETOPT_LONG=	yes
19
USE_REINPLACE=	yes
20
USE_REINPLACE=	yes
20
USE_GMAKE=	yes
21
USE_GMAKE=	yes
21
USE_INC_LIBTOOL_VER=	13
22
USE_INC_LIBTOOL_VER=	13
22
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
23
CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
23
CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
24
INSTALLS_SHLIB=	yes
24
INSTALLS_SHLIB=	yes
25
25
Lines 31-52 Link Here
31
			${PTHREAD_CFLAGS}
31
			${PTHREAD_CFLAGS}
32
LDFLAGS=	-L${LOCALBASE}/lib ${PTHREAD_LIBS}
32
LDFLAGS=	-L${LOCALBASE}/lib ${PTHREAD_LIBS}
33
33
34
.if !defined(WITHOUT_NLS)
34
.if defined(WITHOUT_NLS)
35
CONFIGURE_ARGS+=	--disable-nls
36
PLIST_SUB+=	NLS="@comment "
37
.else
35
USE_GETTEXT=	yes
38
USE_GETTEXT=	yes
36
PLIST_SUB+=	NLS=""
39
PLIST_SUB+=	NLS=""
37
.else
38
CONFIGURE_ARGS+=--disable-nls
39
PLIST_SUB+=	NLS="@comment "
40
.endif
41
42
.include <bsd.port.pre.mk>
43
44
.if ${OSVERSION} >= 502126
45
BROKEN=		"Does not compile with gcc 3.4.2"
46
.endif
40
.endif
47
41
48
post-patch:
42
post-patch:
49
	@${GREP} -lR "<malloc.h>" ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
43
	@${GREP} -lR "<malloc.h>" ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
50
		's|<malloc\.h>|<stdlib.h>|g'
44
		's|<malloc\.h>|<stdlib.h>|g'
51
45
52
.include <bsd.port.post.mk>
46
.include <bsd.port.mk>
(-)comms/gsmlib/files/patch-configure (-10 lines)
Lines 1-10 Link Here
1
--- configure.orig	Thu Oct 17 05:23:09 2002
2
+++ configure	Sat Nov 30 07:16:22 2002
3
@@ -7400,6 +7400,7 @@
4
 
5
 # This can be used to rebuild libtool when needed
6
 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7
+$ac_aux_dir/ltconfig $LIBTOOL_DEPS
8
 
9
 # Always use our own libtool.
10
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
(-)comms/gsmlib/files/patch-gsmlib::gsm_map_key.h (+34 lines)
Line 0 Link Here
1
--- gsmlib/gsm_map_key.h.orig	Wed May 15 04:38:12 2002
2
+++ gsmlib/gsm_map_key.h	Wed Aug 18 22:19:20 2004
3
@@ -25,6 +25,16 @@
4
 
5
   // wrapper for map key, can access Sortedtore to get sortOrder()
6
 
7
+  template <class SortedStore> class MapKey;
8
+  
9
+  // compare two keys
10
+  template <class SortedStore>
11
+    extern bool operator<(const MapKey<SortedStore> &x,
12
+                          const MapKey<SortedStore> &y);
13
+  template <class SortedStore>
14
+    extern bool operator==(const MapKey<SortedStore> &x,
15
+                           const MapKey<SortedStore> &y);
16
+  
17
   template <class SortedStore> class MapKey
18
   {
19
     SortedStore &_myStore;   // my store
20
@@ -61,14 +71,6 @@
21
                        const MapKey<SortedStore> &y);
22
   };
23
 
24
-  // compare two keys
25
-  template <class SortedStore>
26
-    extern bool operator<(const MapKey<SortedStore> &x,
27
-                          const MapKey<SortedStore> &y);
28
-  template <class SortedStore>
29
-    extern bool operator==(const MapKey<SortedStore> &x,
30
-                           const MapKey<SortedStore> &y);
31
-  
32
   // MapKey members
33
   
34
   template <class SortedStore>
(-)comms/gsmlib/files/patch-gsmlib::gsm_unix_serial.cc (-8 / +82 lines)
Lines 1-10 Link Here
1
--- gsmlib/gsm_unix_serial.cc.orig	Thu Jul 17 20:44:42 2003
1
--- gsmlib/gsm_unix_serial.cc.orig	Sun Sep 22 20:51:10 2002
2
+++ gsmlib/gsm_unix_serial.cc	Thu Jul 17 20:44:54 2003
2
+++ gsmlib/gsm_unix_serial.cc	Wed Aug 18 01:27:08 2004
3
@@ -16,6 +16,7 @@
3
@@ -20,6 +20,7 @@
4
 #include <gsmlib/gsm_nls.h>
5
 #include <gsmlib/gsm_unix_serial.h>
6
 #include <gsmlib/gsm_util.h>
7
+#include <assert.h>
8
 #include <termios.h>
9
 #include <fcntl.h>
4
 #include <fcntl.h>
10
 #include <iostream>
5
 #include <iostream>
6
 #include <strstream>
7
+#include <cassert>
8
 #include <errno.h>
9
 #include <stdio.h>
10
 #include <unistd.h>
11
@@ -178,11 +179,15 @@
12
 
13
   // switch off non-blocking mode
14
   int fdFlags;
15
-  if ((fdFlags = fcntl(_fd, F_GETFL)) == -1)
16
+  if ((fdFlags = fcntl(_fd, F_GETFL)) == -1) {
17
+    close(_fd);
18
     throwModemException(_("getting file status flags failed"));
19
+  }
20
   fdFlags &= ~O_NONBLOCK;
21
-  if (fcntl(_fd, F_SETFL, fdFlags) == -1)
22
+  if (fcntl(_fd, F_SETFL, fdFlags) == -1) {
23
+    close(_fd);
24
     throwModemException(_("switching of non-blocking mode failed"));
25
+  }
26
 
27
   long int saveTimeoutVal = _timeoutVal;
28
   _timeoutVal = 3;
29
@@ -194,17 +199,22 @@
30
 
31
     // toggle DTR to reset modem
32
     int mctl = TIOCM_DTR;
33
-    if (ioctl(_fd, TIOCMBIC, &mctl) < 0)
34
+    if (ioctl(_fd, TIOCMBIC, &mctl) < 0) {
35
+      close(_fd);
36
       throwModemException(_("clearing DTR failed"));
37
+    }
38
     // the waiting time for DTR toggling is increased with each loop
39
     usleep(holdoff[initTries]);
40
-    if (ioctl(_fd, TIOCMBIS, &mctl) < 0)
41
+    if (ioctl(_fd, TIOCMBIS, &mctl) < 0) {
42
+      close(_fd);
43
       throwModemException(_("setting DTR failed"));
44
-  
45
+    }
46
     // get line modes
47
-    if (tcgetattr(_fd, &t) < 0)
48
+    if (tcgetattr(_fd, &t) < 0) {
49
+      close(_fd);
50
       throwModemException(stringPrintf(_("tcgetattr device '%s'"),
51
                                        device.c_str()));
52
+    }
53
 
54
     // set line speed
55
     cfsetispeed(&t, lineSpeed);
56
@@ -229,9 +239,11 @@
57
     t.c_cc[VSUSP] = 0;
58
 
59
     // write back
60
-    if(tcsetattr (_fd, TCSANOW, &t) < 0)
61
+    if(tcsetattr (_fd, TCSANOW, &t) < 0) {
62
+      close(_fd);
63
       throwModemException(stringPrintf(_("tcsetattr device '%s'"),
64
                                        device.c_str()));
65
+    }
66
     // the waiting time for writing to the ME/TA is increased with each loop
67
     usleep(holdoff[initTries]);
68
 
69
@@ -279,11 +291,14 @@
70
     catch (GsmException &e)
71
     {
72
       _timeoutVal = saveTimeoutVal;
73
-      if (initTries == 0)
74
+      if (initTries == 0) {
75
+        close(_fd);
76
         throw e;
77
+      }
78
     }
79
   }
80
   // no response after 3 tries
81
+  close(_fd);
82
   throw GsmException(stringPrintf(_("reset modem failed '%s'"),
83
                                   device.c_str()), OtherError);
84
 }

Return to bug 70628