From 614c87b4becd116b0c89d4161919bb7eb21ac2b9 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Thu, 2 Apr 2009 13:01:07 +0000 Subject: [PATCH] documentation improvements, gcc 4.3 warning fix --- Util/include/Poco/Util/HelpFormatter.h | 5 ++++- Util/src/ServerApplication.cpp | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Util/include/Poco/Util/HelpFormatter.h b/Util/include/Poco/Util/HelpFormatter.h index 9d56c219a..c39c8dd75 100644 --- a/Util/include/Poco/Util/HelpFormatter.h +++ b/Util/include/Poco/Util/HelpFormatter.h @@ -1,7 +1,7 @@ // // HelpFormatter.h // -// $Id: //poco/svn/Util/include/Poco/Util/HelpFormatter.h#1 $ +// $Id: //poco/Main/Util/include/Poco/Util/HelpFormatter.h#3 $ // // Library: Util // Package: Options @@ -116,6 +116,9 @@ public: /// Enables Unix-style options. Both short and long option names /// are printed if Unix-style is set. Otherwise, only long option /// names are printed. + /// + /// After calling setUnixStyle(), setAutoIndent() should be called + /// as well to ensure proper help text formatting. bool isUnixStyle() const; /// Returns if Unix-style options are set. diff --git a/Util/src/ServerApplication.cpp b/Util/src/ServerApplication.cpp index 7dd02bc1f..76f81b8f9 100644 --- a/Util/src/ServerApplication.cpp +++ b/Util/src/ServerApplication.cpp @@ -1,7 +1,7 @@ // // ServerApplication.cpp // -// $Id: //poco/Main/Util/src/ServerApplication.cpp#27 $ +// $Id: //poco/Main/Util/src/ServerApplication.cpp#28 $ // // Library: Util // Package: Application @@ -472,9 +472,12 @@ void ServerApplication::beDaemon() // instead of just closing them. This avoids // issues with third party/legacy code writing // stuff to stdout/stderr. - freopen("/dev/null", "r+", stdin); - freopen("/dev/null", "r+", stdout); - freopen("/dev/null", "r+", stderr); + FILE* fin = freopen("/dev/null", "r+", stdin); + if (!fin) throw Poco::OpenFileException("Cannot attach stdin to /dev/null"); + FILE* fout = freopen("/dev/null", "r+", stdout); + if (!fout) throw Poco::OpenFileException("Cannot attach stdout to /dev/null"); + FILE* ferr = freopen("/dev/null", "r+", stderr); + if (!ferr) throw Poco::OpenFileException("Cannot attach stderr to /dev/null"); }