summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/Handle.h3
-rw-r--r--include/Socket.h2
-rw-r--r--include/TaskMan.h2
-rw-r--r--include/gettext.h2
-rw-r--r--lib/Exceptions.cc10
-rw-r--r--lib/Handle.cc7
-rw-r--r--lib/ReadJob.cc2
-rw-r--r--lib/Socket.cc4
-rw-r--r--lib/TaskMan.cc2
9 files changed, 25 insertions, 9 deletions
diff --git a/include/Handle.h b/include/Handle.h
index 4223cf9..6628013 100644
--- a/include/Handle.h
+++ b/include/Handle.h
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Handle.h,v 1.35 2006-01-31 17:02:38 pixel Exp $ */
+/* $Id: Handle.h,v 1.36 2006-11-14 10:10:10 pixel Exp $ */
#ifndef __HANDLE_H__
#define __HANDLE_H__
@@ -74,6 +74,7 @@ class Handle : public Base {
virtual ssize_t nread(void *, size_t) throw (GeneralException);
virtual int ndup() const throw (GeneralException);
virtual int nclose() throw (GeneralException);
+ void tagclose();
private:
ssize_t uwrite(const void *, size_t) throw (GeneralException);
ssize_t uread(void *, size_t);
diff --git a/include/Socket.h b/include/Socket.h
index 77bfedd..4c79237 100644
--- a/include/Socket.h
+++ b/include/Socket.h
@@ -11,7 +11,7 @@ class Socket : public Handle {
public:
Socket() throw (GeneralException);
Socket(const Socket &);
- virtual ~Socket() { close(); }
+ virtual ~Socket() { if (!IsClosed()) { nclose(); tagclose(); } }
bool SetLocal(const String &, int = 0);
bool Connect(const String &, int);
bool Listen();
diff --git a/include/TaskMan.h b/include/TaskMan.h
index 7ceba4a..4470778 100644
--- a/include/TaskMan.h
+++ b/include/TaskMan.h
@@ -27,6 +27,7 @@ class TaskMan : public Base {
static Handle * Ehandle();
static int Eprocess();
static int Estatus();
+ static void SigChild();
class w4ha_t {
public:
@@ -70,7 +71,6 @@ class TaskMan : public Base {
static sigset_t sigchildset;
static int got_sigchild;
static bool CheckDead(Task *);
- static void SigChild();
};
#endif
diff --git a/include/gettext.h b/include/gettext.h
index de7395c..6cb591a 100644
--- a/include/gettext.h
+++ b/include/gettext.h
@@ -45,7 +45,9 @@
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
# define setlocale(category, locale)
+#ifndef LC_ALL
# define LC_ALL 0
+#endif
#endif
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc
index 096ba46..f37832d 100644
--- a/lib/Exceptions.cc
+++ b/lib/Exceptions.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Exceptions.cc,v 1.40 2006-10-28 16:42:19 pixel Exp $ */
+/* $Id: Exceptions.cc,v 1.41 2006-11-14 10:10:10 pixel Exp $ */
#include <string.h>
#include <errno.h>
@@ -38,6 +38,10 @@
#ifdef HAVE_PIPE
#include <unistd.h>
#endif
+#ifdef HAVE_FORK
+#include <sys/types.h>
+#include <sys/wait.h>
+#endif
#include "BString.h"
#include "Exceptions.h"
#include "generic.h"
@@ -208,9 +212,9 @@ pid_t xfork() throw (GeneralException) {
}
#endif
-#ifdef HAVE_WAIT
+#ifdef HAVE_FORK
pid_t xwait(int * s) throw (GeneralException) {
- return wait(s);
+ return ::wait(s);
}
#else
pid_t xwait(int *) throw (GeneralException) {
diff --git a/lib/Handle.cc b/lib/Handle.cc
index b61e063..ceb10f6 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Handle.cc,v 1.77 2006-02-02 14:09:48 pixel Exp $ */
+/* $Id: Handle.cc,v 1.78 2006-11-14 10:10:10 pixel Exp $ */
#include <stdio.h>
#include <string.h>
@@ -238,6 +238,11 @@ Handle & operator>>(Handle & h, String & s) {
return h;
}
+void Handle::tagclose() {
+ closed = 1;
+ h = -1;
+}
+
void Handle::close() throw (GeneralException) {
if (IsClosed()) {
return;
diff --git a/lib/ReadJob.cc b/lib/ReadJob.cc
index f6ef248..7c96876 100644
--- a/lib/ReadJob.cc
+++ b/lib/ReadJob.cc
@@ -28,7 +28,7 @@ int ReadJob::Do() throw (GeneralException) {
}
case 1:
try {
- *d << buff << endnl;
+ *d << buff << "\n";
}
catch (IOAgain e) {
current = 1;
diff --git a/lib/Socket.cc b/lib/Socket.cc
index 5a6cede..f417bf9 100644
--- a/lib/Socket.cc
+++ b/lib/Socket.cc
@@ -208,5 +208,9 @@ int Socket::ndup() const throw (GeneralException) {
}
int Socket::nclose() throw (GeneralException) {
+#ifdef _WIN32
return closesocket(GetHandle());
+#else
+ return Handle::nclose();
+#endif
}
diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc
index a1aa4b1..31ed942 100644
--- a/lib/TaskMan.cc
+++ b/lib/TaskMan.cc
@@ -225,7 +225,7 @@ void TaskMan::Init() throw (GeneralException) {
#ifndef _WIN32
signal(SIGCHLD, taskman_sigchild);
- signal(SIGPIPE, taskman_sighole);
+ signal(SIGPIPE, taskman_sigpipe);
signal(SIGHUP, taskman_sighup);
sigemptyset(&sigchildset);