diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-07-05 19:28:31 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-07-05 19:28:31 +0000 |
commit | 35fce7de6b3ff302dab90f8013d9ebd434f90b03 (patch) | |
tree | 6c8573269a13c47d2a1df9cc4f874e07d5db101b /lib/server | |
parent | c79d76b9c317b6469ad48eb296d807e6da261190 (diff) |
Use a signed int instead of char for getopt, thanks Martin. (refs #3)
Diffstat (limited to 'lib/server')
-rw-r--r-- | lib/server/Daemon.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp index 34ac0440..147eeb24 100644 --- a/lib/server/Daemon.cpp +++ b/lib/server/Daemon.cpp @@ -110,7 +110,7 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) int masterLevel = Log::INFO; // need an int to do math with #endif - signed char c; + signed int c; // reset getopt, just in case anybody used it before. // unfortunately glibc and BSD differ on this point! @@ -122,16 +122,8 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) optreset = 1; #endif - BOX_TRACE("'?' == " << (int)'?'); - while((c = getopt(argc, (char * const *)argv, "c:DFqvVt:Tk")) != -1) { - BOX_TRACE("getopt: returned '" << c << "' (" << (int)c << ")"); - BOX_TRACE("getopt: optind = " << optind); - BOX_TRACE("getopt: optopt = " << optopt); - BOX_TRACE("getopt: optarg = " << optarg); - BOX_TRACE("getopt: argv[optind] = " << argv[optind]); - switch(c) { case 'c': @@ -220,8 +212,6 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) } } - BOX_TRACE("getopt: returned " << (int)c << ", finished."); - if (argc > optind && !haveConfigFile) { mConfigFileName = argv[optind]; optind++; |