summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2003-12-11 18:35:41 +0000
committerJoel Rosdahl <joel@rosdahl.net>2011-08-21 15:53:50 +0200
commitfe6e9de1fd37d3ed338281338462724acb12dfcf (patch)
treec4ea89fc66f876e522b5eb30b1da8113e8e7df6a
parent0afe01e05ea2d3a6d05885b56ed7f00c83032298 (diff)
downloadminiircd-fe6e9de1fd37d3ed338281338462724acb12dfcf.tar.gz
miniircd-fe6e9de1fd37d3ed338281338462724acb12dfcf.zip
Open /dev/null for writing too
-rw-r--r--TODO2
-rwxr-xr-xminiircd6
2 files changed, 3 insertions, 5 deletions
diff --git a/TODO b/TODO
index 529a856..57c0056 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,3 @@
-* Open /dev/null with "w".
-
* Handle bad port specification.
* Wrap long lines.
diff --git a/miniircd b/miniircd
index 95af4ec..1e2a94c 100755
--- a/miniircd
+++ b/miniircd
@@ -19,7 +19,7 @@
#
# Joel Rosdahl <joel@rosdahl.net>
-version = "0.0.0"
+version = "0.1.0"
import getopt
import os
@@ -376,6 +376,7 @@ class Client(object):
self.nickname),
True)
+
def noticeAndPrivmsgHandler():
if len(arguments) == 0:
self.message(":%s 411 %s :No recipient given" % (
@@ -557,7 +558,6 @@ class Client(object):
self.nickname,
command))
-
def socketReadableNotification(self):
try:
data = self.socket.recv(2**10)
@@ -645,7 +645,7 @@ class Server(object):
sys.exit(1)
os.chdir("/")
os.umask(0)
- devNull = file("/dev/null")
+ devNull = file("/dev/null", "r+")
os.dup2(devNull.fileno(), sys.stdout.fileno())
os.dup2(devNull.fileno(), sys.stderr.fileno())
os.dup2(devNull.fileno(), sys.stdin.fileno())