aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/I18n.cc8
-rw-r--r--src/FbTk/SignalHandler.cc8
-rw-r--r--src/FbTk/StringUtil.cc2
-rw-r--r--src/FbTk/Timer.cc4
-rw-r--r--src/RootTheme.cc3
-rw-r--r--src/fluxbox.cc2
-rw-r--r--src/main.cc5
7 files changed, 24 insertions, 8 deletions
diff --git a/src/FbTk/I18n.cc b/src/FbTk/I18n.cc
index 81ff078..3daa2e9 100644
--- a/src/FbTk/I18n.cc
+++ b/src/FbTk/I18n.cc
@@ -72,17 +72,17 @@ void NLSInit(const char *catalog) {
72 72
73 73
74I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)(-1)) { 74I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)(-1)) {
75#ifdef HAVE_SETLOCALE 75#if defined(HAVE_SETLOCALE) && defined(NLS)
76 //make sure we don't get 0 to m_locale string 76 //make sure we don't get 0 to m_locale string
77 char *temp = setlocale(LC_MESSAGES, ""); 77 char *temp = setlocale(LC_MESSAGES, "");
78 m_locale = ( temp ? temp : ""); 78 m_locale = ( temp ? temp : "");
79 if (m_locale.empty()) { 79 if (m_locale.empty()) {
80 cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl; 80 cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl;
81#endif // HAVE_SETLOCALE 81#endif // defined(HAVE_SETLOCALE) && defined(NLS)
82 82
83 m_locale = "C"; 83 m_locale = "C";
84 84
85#ifdef HAVE_SETLOCALE 85#if defined(HAVE_SETLOCALE) && defined(NLS)
86 86
87 } else { 87 } else {
88 88
@@ -102,7 +102,7 @@ I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)
102 if (index != string::npos) 102 if (index != string::npos)
103 m_locale.erase(0,index+1); //erase all characters starting up to index 103 m_locale.erase(0,index+1); //erase all characters starting up to index
104 } 104 }
105#endif // HAVE_SETLOCALE 105#endif // defined(HAVE_SETLOCALE) && defined(NLS)
106} 106}
107 107
108 108
diff --git a/src/FbTk/SignalHandler.cc b/src/FbTk/SignalHandler.cc
index a0a4c4c..5f06210 100644
--- a/src/FbTk/SignalHandler.cc
+++ b/src/FbTk/SignalHandler.cc
@@ -46,6 +46,7 @@ bool SignalHandler::registerHandler(int signum, SignalEventHandler *eh,
46 if (oldhandler_ret != 0) 46 if (oldhandler_ret != 0)
47 *oldhandler_ret = s_signal_handler[signum]; 47 *oldhandler_ret = s_signal_handler[signum];
48 48
49#ifdef HAVE_SIGACTION
49 struct sigaction sa; 50 struct sigaction sa;
50 // set callback 51 // set callback
51 sa.sa_handler = SignalHandler::handleSignal; 52 sa.sa_handler = SignalHandler::handleSignal;
@@ -54,7 +55,12 @@ bool SignalHandler::registerHandler(int signum, SignalEventHandler *eh,
54 55
55 if (sigaction(signum, &sa, 0) == -1) 56 if (sigaction(signum, &sa, 0) == -1)
56 return false; 57 return false;
57 58#else
59 // Fallback code for Windows and other platforms lacking sigaction.
60 if (signal(signum, &SignalHandler::handleSignal) == SIG_ERR) {
61 return false;
62 }
63#endif
58 s_signal_handler[signum] = eh; 64 s_signal_handler[signum] = eh;
59 65
60 return true; 66 return true;
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc
index 0a7ebd3..f76a1f9 100644
--- a/src/FbTk/StringUtil.cc
+++ b/src/FbTk/StringUtil.cc
@@ -176,7 +176,7 @@ string expandFilename(const string &filename) {
176 size_t pos = filename.find_first_not_of(" \t"); 176 size_t pos = filename.find_first_not_of(" \t");
177 if (pos != string::npos && filename[pos] == '~') { 177 if (pos != string::npos && filename[pos] == '~') {
178 retval = getenv("HOME"); 178 retval = getenv("HOME");
179 if (pos != filename.size()) { 179 if (pos + 1 < filename.size()) {
180 // copy from the character after '~' 180 // copy from the character after '~'
181 retval += static_cast<const char *>(filename.c_str() + pos + 1); 181 retval += static_cast<const char *>(filename.c_str() + pos + 1);
182 } 182 }
diff --git a/src/FbTk/Timer.cc b/src/FbTk/Timer.cc
index 9b3fe8c..4d9f54f 100644
--- a/src/FbTk/Timer.cc
+++ b/src/FbTk/Timer.cc
@@ -49,7 +49,9 @@
49# include <string.h> 49# include <string.h>
50#endif 50#endif
51 51
52#include <sys/select.h> 52#ifdef HAVE_SYS_SELECT_H
53# include <sys/select.h>
54#endif
53 55
54namespace FbTk { 56namespace FbTk {
55 57
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index d303834..a2aa4a8 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -40,7 +40,10 @@
40#include <iostream> 40#include <iostream>
41 41
42#include <sys/types.h> 42#include <sys/types.h>
43#ifdef HAVE_SYS_WAIT_H
43#include <sys/wait.h> 44#include <sys/wait.h>
45#endif
46
44#ifdef HAVE_CSTRING 47#ifdef HAVE_CSTRING
45 #include <cstring> 48 #include <cstring>
46#else 49#else
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 2e5e373..ff44e9f 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -124,7 +124,9 @@
124#include <sys/stat.h> 124#include <sys/stat.h>
125#endif // HAVE_SYS_STAT_H 125#endif // HAVE_SYS_STAT_H
126 126
127#ifdef HAVE_SYS_WAIT_H
127#include <sys/wait.h> 128#include <sys/wait.h>
129#endif // HAVE_SYS_WAIT_H
128 130
129#include <iostream> 131#include <iostream>
130#include <memory> 132#include <memory>
diff --git a/src/main.cc b/src/main.cc
index 1e80c4b..7541a28 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -374,10 +374,11 @@ void setupConfigFiles(const std::string& dirname, const std::string& rc) {
374 sync_fs = true; 374 sync_fs = true;
375 } 375 }
376 } 376 }
377 377#ifdef HAVE_SYNC
378 if (sync_fs) { 378 if (sync_fs) {
379 sync(); 379 sync();
380 } 380 }
381#endif
381} 382}
382 383
383 384
@@ -414,7 +415,9 @@ void updateConfigFilesIfNeeded(const std::string& rc_file) {
414 << commandargs 415 << commandargs
415 << "' failed." << endl; 416 << "' failed." << endl;
416 } 417 }
418#ifdef HAVE_SYNC
417 sync(); 419 sync();
420#endif // HAVE_SYNC
418 } 421 }
419} 422}
420 423