[-]
[+]
|
Changed |
lfc.changes
|
|
[-]
[+]
|
Changed |
lfc.spec
^
|
|
[-]
[+]
|
Changed |
lfc-1.3.3.tar.bz2/README
^
|
@@ -4,7 +4,7 @@
------------------------------
A collection of basic c++ classes
- Version 1.3.2
+ Version 1.3.3
(C)opyright 2005,2006,2007,2008,2009,2010,2011,2012 Bjoern Lemke
|
[-]
[+]
|
Changed |
lfc-1.3.3.tar.bz2/src/CommandExecuter.cc
^
|
@@ -40,8 +40,12 @@
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
-#include <sys/wait.h>
+#ifdef HAVE_MINGW32
+// not implemented
+#else
+#include <sys/wait.h>
+#endif
// BASE INCLUDES
#include "Exception.h"
@@ -66,6 +70,13 @@
int CommandExecuter::execute(const Chain& command, int timeout)
{
+#ifdef HAVE_MINGW32
+
+ // not implemented
+ return 0;
+
+#else
+
alarm(0);
alarm(timeout);
@@ -112,11 +123,19 @@
Chain msg = "Cannot execute command <" + command + ">";
throw Exception(EXLOC, msg);
}
+#endif
+
}
void CommandExecuter::sigCatch(int sig)
-{
+{
+
+#ifdef HAVE_MINGW32
+ // not implemented
+#else
kill(_childPid, SIGTERM);
_childPid = 0;
+#endif
+
};
|
[-]
[+]
|
Changed |
lfc-1.3.3.tar.bz2/src/Makefile.in
^
|
@@ -85,7 +85,7 @@
$(INSTALL_DATA) Base64Coder.h $(DESTDIR)$(INCLUDEPREFIX)
if [ -f regex.o ]; then $(INSTALL_DATA) regex.h $(DESTDIR)$(INCLUDEPREFIX); fi
$(INSTALL_DATA) liblfc.a $(DESTDIR)$(LIBPREFIX)
- $(INSTALL_DATA) liblfc.so.1 $(DESTDIR)$(LIBPREFIX)
+ if [ -f liblfc.so.1 ]; then $(INSTALL_DATA) liblfc.so.1 $(DESTDIR)$(LIBPREFIX); fi
$(RANLIB) $(DESTDIR)$(LIBPREFIX)/liblfc.a
clean:
@@ -99,11 +99,10 @@
#################
liblfc: $(OBJECTS)
- $(CC) $(LDFLAGS) $(SHLIBOPT) -o liblfc.so.1 $(OBJECTS)
+ if [ -n "$(SHLIBOPT)" ]; then $(CC) $(LDFLAGS) $(SHLIBOPT) -o liblfc.so.1 $(OBJECTS); fi
$(AR) -r liblfc.a $(OBJECTS)
$(RANLIB) liblfc.a
-
#######################
# Module Dependencies #
#######################
|
[-]
[+]
|
Changed |
lfc-1.3.3.tar.bz2/src/Net.cc
^
|
@@ -42,8 +42,10 @@
#include <fcntl.h>
#ifdef HAVE_MINGW32
+#define WINVER 0x0501
#include <windows.h>
#include <winsock2.h>
+#include <ws2tcpip.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
@@ -236,7 +238,11 @@
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM;
+#ifdef HAVE_MINGW32
+ hints.ai_family = AF_INET;
+#else
hints.ai_family = PF_UNSPEC;
+#endif
if ((err = getaddrinfo((char*)hostname, (char*)service, &hints, &res0)) != 0)
{
@@ -280,14 +286,19 @@
NetHandler* Net::connect(const Chain& hostname, const Chain& service, int timeout)
{
-
struct addrinfo hints, *res0, *res;
int err;
int sock;
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM;
+
+#ifdef HAVE_MINGW32
+ hints.ai_family = AF_INET;
+#else
hints.ai_family = PF_UNSPEC;
+#endif
+
if ((err = getaddrinfo((char*)hostname, (char*)service, &hints, &res0)) != 0)
{
@@ -304,6 +315,17 @@
}
+#ifdef HAVE_MINGW32
+ // no blocking supported
+
+ if ( ::connect(sock, res->ai_addr, res->ai_addrlen) != 0)
+ {
+ close(sock);
+ continue;
+ }
+
+#else
+
int opt;
if ((opt = fcntl(sock, F_GETFL, NULL)) < 0)
@@ -317,7 +339,6 @@
Chain msg = Chain("fcntl system error : ") + Chain(strerror(errno));
throw Exception(EXLOC, msg);
}
-
if ( ::connect(sock, res->ai_addr, res->ai_addrlen) != 0)
{
@@ -351,7 +372,8 @@
continue;
}
}
-
+#endif
+
break;
}
@@ -377,7 +399,12 @@
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM;
+
+#ifdef HAVE_MINGW32
+ hints.ai_family = AF_INET;
+#else
hints.ai_family = PF_UNSPEC;
+#endif
if ((err = getaddrinfo((char*)hostname, (char*)service, &hints, &res)) != 0)
{
@@ -394,7 +421,11 @@
throw Exception(EXLOC, "socket system error");
int optVal = 1;
+#ifdef HAVE_MINGW32
+ if ( setsockopt(_csock, SOL_SOCKET, SO_REUSEADDR, (char*)&optVal, sizeof(int)) )
+#else
if ( setsockopt(_csock, SOL_SOCKET, SO_REUSEADDR, &optVal, sizeof(int)) )
+#endif
{
Chain msg = Chain("setsockopt system error : ") + Chain(strerror(errno));
throw Exception(EXLOC, msg);
@@ -439,7 +470,13 @@
int optVal = 1;
+
+#ifdef HAVE_MINGW32
+ if ( setsockopt(_csock, SOL_SOCKET, SO_REUSEADDR, (char*)&optVal, sizeof(int)) )
+#else
if ( setsockopt(_csock, SOL_SOCKET, SO_REUSEADDR, &optVal, sizeof(int)) )
+#endif
+
{
Chain msg = Chain("setsockopt system error : ") + Chain(strerror(errno));
throw Exception(EXLOC, msg);
|
[-]
[+]
|
Changed |
lfc-1.3.3.tar.bz2/src/SigHandler.cc
^
|
@@ -6,7 +6,7 @@
//
// Design and Implementation by Bjoern Lemke
//
-// (C)opyright 2000-2005 Bjoern Lemke
+// (C)opyright 2000-2012 Bjoern Lemke
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -79,13 +79,23 @@
{
#ifdef HAVE_MINGW32
+
signal(sig, SigHandler::handleSig);
+
#else
+
struct sigaction sa;
sa.sa_handler = SigHandler::handleSig;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART; /* Restart functions if interrupted by handler */
+
+ if (sigaction(sig, &sa, NULL) == -1)
+ {
+ throw Exception(EXLOC, "signal system error");
+ }
+
+#endif
bool notSet = true;
int i = 0;
@@ -114,10 +124,7 @@
throw Exception(EXLOC, "No more signal slots available");
}
- if (sigaction(sig, &sa, NULL) == -1)
- {
- throw Exception(EXLOC, "signal system error");
- }
+
#endif
}
@@ -125,6 +132,8 @@
void SigHandler::handleSig(int sig)
{
+
+
int i = 0;
while ( i< MAXSIGHANDLER )
{
|
[-]
[+]
|
Changed |
lfc-1.3.3.tar.bz2/src/Version.cc
^
|
@@ -32,8 +32,4 @@
// Status: IMPLEMENTED
///////////////////////////////////////////////////////////////////////////////
-char __lfcVersionString[] = "1.3.2";
-
-
-
-
+char __lfcVersionString[] = "1.3.3";
|