[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-491
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-491-gf038505 |
Date: |
Mon, 25 Apr 2011 16:24:04 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".
The branch, master has been updated
via f0385054dd3832aed991be1f41f47fa0de39920a (commit)
via cefd28671e6d17e276e0a18ea39c19d87d5a2059 (commit)
from 7fc18d70ec79a6d373880e930c1869f676c143ea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f0385054dd3832aed991be1f41f47fa0de39920a
Author: Giuseppe Scrivano <address@hidden>
Date: Mon Apr 25 16:43:45 2011 +0200
ForkServer: kill the server on errors.
diff --git a/myserver/src/base/process/fork_server.cpp
b/myserver/src/base/process/fork_server.cpp
index 8c3121b..0e7aaa4 100644
--- a/myserver/src/base/process/fork_server.cpp
+++ b/myserver/src/base/process/fork_server.cpp
@@ -265,7 +265,7 @@ int ForkServer::forkServerLoop (UnixSocket *serverSocket)
{
serverSocket->close ();
socket.close ();
- perror ("fork server died.");
+ fprintf (stderr, "fork server died.\n");
exit (1);
}
}
diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index ce21472..f784cb4 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -521,6 +521,8 @@ int main (int argn, char **argv)
}
catch (...)
{
+ if (input.useForkServer)
+ Process::getForkServer ()->killServer ();
return 1;
};
commit cefd28671e6d17e276e0a18ea39c19d87d5a2059
Author: Giuseppe Scrivano <address@hidden>
Date: Mon Apr 25 16:39:59 2011 +0200
Fix load configuration files from the home directory.
diff --git a/myserver/include/base/home_dir/home_dir.h
b/myserver/include/base/home_dir/home_dir.h
index 234489b..0ab67f6 100644
--- a/myserver/include/base/home_dir/home_dir.h
+++ b/myserver/include/base/home_dir/home_dir.h
@@ -42,6 +42,8 @@ public:
int isLoaded (){return loaded;}
+ void getLoginName (string &username);
+
private:
Mutex loadMutex;
int loadImpl ();
diff --git a/myserver/src/base/home_dir/home_dir.cpp
b/myserver/src/base/home_dir/home_dir.cpp
index e1d3670..97cfad8 100644
--- a/myserver/src/base/home_dir/home_dir.cpp
+++ b/myserver/src/base/home_dir/home_dir.cpp
@@ -123,6 +123,26 @@ int HomeDir::load ()
return ret;
}
+void HomeDir::getLoginName (string &username)
+{
+ username.assign ("");
+#ifdef WIN32
+ char login[1024];
+ DWORD sz = sizeof (login);
+
+ if (GetUserName (login, &sz))
+ username.assign (login);
+
+ return;
+#else
+ const char *login = getlogin ();
+ if (login)
+ username.assign (login);
+
+ return;
+#endif
+}
+
/*!
Load the internal buffer.
*/
diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index cd75834..ce21472 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -24,6 +24,7 @@
#include <include/conf/main/xml_main_configuration.h>
#include <include/base/exceptions/checked.h>
+#include <include/base/home_dir/home_dir.h>
#ifdef WIN32
# include <direct.h>
@@ -304,7 +305,13 @@ int loadConfFileLocation (string &outFile, string
fileName, const char *dir)
return 0;
}
- outFile = "~/.myserver/" + fileName;
+ HomeDir homeDir;
+ string login;
+ homeDir.getLoginName (login);
+ homeDir.getHomeDir (login, outFile);
+
+ outFile.append ("/.myserver/");
+ outFile.append (fileName);
if (FilesUtility::nodeExists (outFile))
return 0;
-----------------------------------------------------------------------
Summary of changes:
myserver/include/base/home_dir/home_dir.h | 2 ++
myserver/src/base/home_dir/home_dir.cpp | 20 ++++++++++++++++++++
myserver/src/base/process/fork_server.cpp | 2 +-
myserver/src/myserver.cpp | 11 ++++++++++-
4 files changed, 33 insertions(+), 2 deletions(-)
hooks/post-receive
--
GNU MyServer
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-491-gf038505,
Giuseppe Scrivano <=