-rw-r--r-- | core/launcher/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index 073e19a..762a596 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp | |||
@@ -29,12 +29,13 @@ | |||
29 | #include <qpe/custom.h> | 29 | #include <qpe/custom.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #include <opie/odevice.h> | 32 | #include <opie/odevice.h> |
33 | 33 | ||
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qimage.h> | ||
35 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
36 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
37 | #include <qpe/alarmserver.h> | 38 | #include <qpe/alarmserver.h> |
38 | 39 | ||
39 | #include <stdlib.h> | 40 | #include <stdlib.h> |
40 | #include <stdio.h> | 41 | #include <stdio.h> |
@@ -50,13 +51,13 @@ using namespace Opie; | |||
50 | void initEnvironment() | 51 | void initEnvironment() |
51 | { | 52 | { |
52 | Config config("locale"); | 53 | Config config("locale"); |
53 | config.setGroup( "Location" ); | 54 | config.setGroup( "Location" ); |
54 | QString tz = config.readEntry( "Timezone", getenv("TZ") ); | 55 | QString tz = config.readEntry( "Timezone", getenv("TZ") ); |
55 | 56 | ||
56 | // if not timezone set, pick New York | 57 | // if not timezone set, pick New York |
57 | if (tz.isNull()) | 58 | if (tz.isNull()) |
58 | tz = "America/New_York"; | 59 | tz = "America/New_York"; |
59 | 60 | ||
60 | setenv( "TZ", tz, 1 ); | 61 | setenv( "TZ", tz, 1 ); |
61 | config.writeEntry( "Timezone", tz); | 62 | config.writeEntry( "Timezone", tz); |
62 | 63 | ||
@@ -126,13 +127,13 @@ int initApplication( int argc, char ** argv ) | |||
126 | 127 | ||
127 | static const char *pidfile_path = "/var/run/opie.pid"; | 128 | static const char *pidfile_path = "/var/run/opie.pid"; |
128 | 129 | ||
129 | void create_pidfile ( ) | 130 | void create_pidfile ( ) |
130 | { | 131 | { |
131 | FILE *f; | 132 | FILE *f; |
132 | 133 | ||
133 | if (( f = ::fopen ( pidfile_path, "w" ))) { | 134 | if (( f = ::fopen ( pidfile_path, "w" ))) { |
134 | ::fprintf ( f, "%d", getpid ( )); | 135 | ::fprintf ( f, "%d", getpid ( )); |
135 | ::fclose ( f ); | 136 | ::fclose ( f ); |
136 | } | 137 | } |
137 | } | 138 | } |
138 | 139 | ||
@@ -153,13 +154,13 @@ int main( int argc, char ** argv ) | |||
153 | 154 | ||
154 | ::signal ( SIGTERM, handle_sigterm ); | 155 | ::signal ( SIGTERM, handle_sigterm ); |
155 | ::signal ( SIGINT, handle_sigterm ); | 156 | ::signal ( SIGINT, handle_sigterm ); |
156 | 157 | ||
157 | ::setsid ( ); | 158 | ::setsid ( ); |
158 | ::setpgid ( 0, 0 ); | 159 | ::setpgid ( 0, 0 ); |
159 | 160 | ||
160 | ::atexit ( remove_pidfile ); | 161 | ::atexit ( remove_pidfile ); |
161 | create_pidfile ( ); | 162 | create_pidfile ( ); |
162 | 163 | ||
163 | int retVal = initApplication ( argc, argv ); | 164 | int retVal = initApplication ( argc, argv ); |
164 | 165 | ||
165 | // Kill them. Kill them all. | 166 | // Kill them. Kill them all. |