summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2005-06-14 13:47:09 +0000
committerdeva <deva>2005-06-14 13:47:09 +0000
commit2348bf307ca32bb65b54017ee1906fda48b55087 (patch)
tree85cca82f91602c63ed7e8028cff1983aff0dc9ef
parent430524810e67d3c223a2ab819f45b882b419c45d (diff)
*** empty log message ***
-rw-r--r--src/daemon.cc7
-rw-r--r--src/info.cc5
-rw-r--r--src/info_console.cc4
-rw-r--r--src/miav_daemon.cc4
4 files changed, 12 insertions, 8 deletions
diff --git a/src/daemon.cc b/src/daemon.cc
index e80af78..fc42ee7 100644
--- a/src/daemon.cc
+++ b/src/daemon.cc
@@ -40,7 +40,7 @@ Daemon::~Daemon()
int Daemon::run(uid_t uid, gid_t gid)
{
int f;
- // int fd;
+ int fd;
chdir("/");
umask(0);
@@ -62,13 +62,14 @@ int Daemon::run(uid_t uid, gid_t gid)
fprintf(stderr, "Failed to change to uid %d, quitting.\n", uid);
return 1;
}
- /* // Redirect stdin, stdout and stderr to /dev/null
+
+ // Redirect stdin, stdout and stderr to /dev/null
fd = open("/dev/null", O_NOCTTY | O_RDWR, 0666);
dup2(0, fd);
dup2(1, fd);
dup2(2, fd);
- */
+
setsid();
signal (SIGTERM, SIG_IGN);
diff --git a/src/info.cc b/src/info.cc
index 56d1dfd..effa887 100644
--- a/src/info.cc
+++ b/src/info.cc
@@ -31,6 +31,9 @@
/*
* $Log$
+ * Revision 1.3 2005/06/14 13:47:09 deva
+ * *** empty log message ***
+ *
* Revision 1.2 2005/06/14 12:29:40 deva
* Incorporated the use of the Info object everywhere... also using the log functionality.
*
@@ -75,7 +78,7 @@ void Info::log(char *fmt, ...)
strftime(sdate, sizeof(sdate), "%d %b %H:%M:%S", localtime(&t));
fprintf(fp, "%s miav[%d] %s\n", sdate, getpid(), buf);
- fprintf(stderr, "%s miav[%d] %s\n", sdate, getpid(), buf);
+ // fprintf(stderr, "%s miav[%d] %s\n", sdate, getpid(), buf);
fclose(fp);
diff --git a/src/info_console.cc b/src/info_console.cc
index a860dd8..fc82de4 100644
--- a/src/info_console.cc
+++ b/src/info_console.cc
@@ -26,11 +26,11 @@
*/
/*
- * $Id$
+ * $Id:$
*/
/*
- * $Log$
+ * $Log:$
*/
#include <config.h>
diff --git a/src/miav_daemon.cc b/src/miav_daemon.cc
index 2d679c3..d59d7ec 100644
--- a/src/miav_daemon.cc
+++ b/src/miav_daemon.cc
@@ -31,8 +31,8 @@
/*
* $Log$
- * Revision 1.2 2005/06/14 12:29:40 deva
- * Incorporated the use of the Info object everywhere... also using the log functionality.
+ * Revision 1.3 2005/06/14 13:47:09 deva
+ * *** empty log message ***
*
* Revision 1.1 2005/06/09 11:00:03 deva
* Added daemon code, and cleaned up using -Wall and -Werror