Index: trunk/tools/switchboard2/swexec.c |
— | — | @@ -168,7 +168,6 @@ |
169 | 169 | int |
170 | 170 | main(int argc, char *argv[]) |
171 | 171 | { |
172 | | - int userdir = 0; /* ~userdir flag */ |
173 | 172 | uid_t uid; /* user information */ |
174 | 173 | gid_t gid; /* target group placeholder */ |
175 | 174 | char *target_uname; /* target user name */ |
— | — | @@ -176,7 +175,6 @@ |
177 | 176 | char *target_homedir; /* target home directory */ |
178 | 177 | char *actual_uname; /* actual user name */ |
179 | 178 | char *actual_gname; /* actual group name */ |
180 | | - char *prog; /* name of this program */ |
181 | 179 | struct passwd *pw; /* password entry holder */ |
182 | 180 | struct group *gr; /* group entry holder */ |
183 | 181 | #ifdef USE_PROJECTS |
— | — | @@ -189,7 +187,6 @@ |
190 | 188 | */ |
191 | 189 | clean_env(); |
192 | 190 | |
193 | | - prog = argv[0]; |
194 | 191 | /* |
195 | 192 | * Check existence/validity of the UID of the user |
196 | 193 | * running this program. Error out if invalid. |
Index: trunk/tools/switchboard2/swkill.c |
— | — | @@ -61,7 +61,6 @@ |
62 | 62 | |
63 | 63 | static void err_output(int is_error, const char *fmt, va_list ap) |
64 | 64 | { |
65 | | -#ifdef SB_LOG_EXEC |
66 | 65 | time_t timevar; |
67 | 66 | struct tm *lt; |
68 | 67 | |
— | — | @@ -88,46 +87,29 @@ |
89 | 88 | vfprintf(log, fmt, ap); |
90 | 89 | |
91 | 90 | fflush(log); |
92 | | -#endif /* SB_LOG_EXEC */ |
93 | 91 | return; |
94 | 92 | } |
95 | 93 | |
96 | 94 | static void log_err(const char *fmt,...) |
97 | 95 | { |
98 | | -#ifdef SB_LOG_EXEC |
99 | 96 | va_list ap; |
100 | 97 | |
101 | 98 | va_start(ap, fmt); |
102 | 99 | err_output(1, fmt, ap); /* 1 == is_error */ |
103 | 100 | va_end(ap); |
104 | | -#endif /* SB_LOG_EXEC */ |
105 | 101 | return; |
106 | 102 | } |
107 | 103 | |
108 | | -static void log_no_err(const char *fmt,...) |
109 | | -{ |
110 | | -#ifdef SB_LOG_EXEC |
111 | | - va_list ap; |
112 | | - |
113 | | - va_start(ap, fmt); |
114 | | - err_output(0, fmt, ap); /* 0 == !is_error */ |
115 | | - va_end(ap); |
116 | | -#endif /* SB_LOG_EXEC */ |
117 | | - return; |
118 | | -} |
119 | | - |
120 | 104 | int main(int argc, char *argv[]) |
121 | 105 | { |
122 | | - char *prog; |
123 | 106 | char *target_uname, *target_gname; |
124 | | - char *actual_uname, *actual_gname; |
| 107 | + char *actual_uname; |
125 | 108 | uid_t uid; /* user information */ |
126 | 109 | gid_t gid; /* target group placeholder */ |
127 | 110 | pid_t target_pid; |
128 | 111 | struct passwd *pw; /* password entry holder */ |
129 | 112 | struct group *gr; /* group entry holder */ |
130 | 113 | |
131 | | - prog = argv[0]; |
132 | 114 | /* |
133 | 115 | * Check existence/validity of the UID of the user |
134 | 116 | * running this program. Error out if invalid. |
— | — | @@ -197,7 +179,6 @@ |
198 | 180 | } |
199 | 181 | } |
200 | 182 | gid = gr->gr_gid; |
201 | | - actual_gname = strdup(gr->gr_name); |
202 | 183 | |
203 | 184 | /* |
204 | 185 | * Save these for later since initgroups will hose the struct |
Index: trunk/tools/switchboard2/config.cc |
— | — | @@ -222,7 +222,7 @@ |
223 | 223 | try { |
224 | 224 | newconf.max_procs = boost::lexical_cast<int>(fields[1]); |
225 | 225 | return true; |
226 | | - } catch (boost::bad_lexical_cast &e) { |
| 226 | + } catch (boost::bad_lexical_cast &) { |
227 | 227 | LOG4CXX_ERROR(logger, |
228 | 228 | format("\"%s\", line %d: usage: max-procs <number>\n") |
229 | 229 | % file_ % lineno_); |
— | — | @@ -245,7 +245,7 @@ |
246 | 246 | try { |
247 | 247 | newconf.max_procs_per_user = boost::lexical_cast<int>(fields[1]); |
248 | 248 | return true; |
249 | | - } catch (boost::bad_lexical_cast &e) { |
| 249 | + } catch (boost::bad_lexical_cast &) { |
250 | 250 | LOG4CXX_ERROR(logger, |
251 | 251 | format("\"%s\", line %d: usage: max-procs-per-user <number>\n") |
252 | 252 | % file_ % lineno_); |
— | — | @@ -268,7 +268,7 @@ |
269 | 269 | try { |
270 | 270 | newconf.max_q_per_user = boost::lexical_cast<int>(fields[1]); |
271 | 271 | return true; |
272 | | - } catch (boost::bad_lexical_cast &e) { |
| 272 | + } catch (boost::bad_lexical_cast &) { |
273 | 273 | LOG4CXX_ERROR(logger, |
274 | 274 | format("\"%s\", line %d: usage: max-q-per-user <number>\n") |
275 | 275 | % file_ % lineno_); |
— | — | @@ -317,7 +317,7 @@ |
318 | 318 | try { |
319 | 319 | newconf.php_timeout = boost::lexical_cast<int>(fields[1]); |
320 | 320 | return true; |
321 | | - } catch (boost::bad_lexical_cast &e) { |
| 321 | + } catch (boost::bad_lexical_cast &) { |
322 | 322 | LOG4CXX_ERROR(logger, |
323 | 323 | format("\"%s\", line %d: usage: php-timeout <number>\n") |
324 | 324 | % file_ % lineno_); |
— | — | @@ -340,7 +340,7 @@ |
341 | 341 | try { |
342 | 342 | newconf.server_timeout = boost::lexical_cast<int>(fields[1]); |
343 | 343 | return true; |
344 | | - } catch (boost::bad_lexical_cast &e) { |
| 344 | + } catch (boost::bad_lexical_cast &) { |
345 | 345 | LOG4CXX_ERROR(logger, |
346 | 346 | format("\"%s\", line %d: usage: server-timeout <number>\n") |
347 | 347 | % file_ % lineno_); |
— | — | @@ -363,7 +363,7 @@ |
364 | 364 | try { |
365 | 365 | newconf.max_request_size = boost::lexical_cast<int>(fields[1]); |
366 | 366 | return true; |
367 | | - } catch (boost::bad_lexical_cast &e) { |
| 367 | + } catch (boost::bad_lexical_cast &) { |
368 | 368 | LOG4CXX_ERROR(logger, |
369 | 369 | format("\"%s\", line %d: usage: max-request-size <number>\n") |
370 | 370 | % file_ % lineno_); |
Index: trunk/tools/switchboard2/process_factory.cc |
— | — | @@ -101,7 +101,6 @@ |
102 | 102 | |
103 | 103 | std::string s = it->second; |
104 | 104 | struct stat sb; |
105 | | - bool err = false; |
106 | 105 | |
107 | 106 | while (stat(s.c_str(), &sb) == -1 |
108 | 107 | && errno == ENOTDIR) |
Index: trunk/tools/switchboard2/fcgi.cc |
— | — | @@ -86,9 +86,7 @@ |
87 | 87 | * padding data variable |
88 | 88 | */ |
89 | 89 | |
90 | | - ssize_t i; |
91 | | - |
92 | | - if ((i = timed_read(fd, static_cast<void *>(rec), 8, timeout)) < 8) { |
| 90 | + if (timed_read(fd, static_cast<void *>(rec), 8, timeout) < 8) { |
93 | 91 | return false; |
94 | 92 | #if 0 |
95 | 93 | std::fprintf(stderr, "couldn't read entire record header\n"); |
Index: trunk/tools/switchboard2/fcgi.h |
— | — | @@ -80,8 +80,8 @@ |
81 | 81 | } |
82 | 82 | |
83 | 83 | void request_id(int n) { |
84 | | - requestId1_ = n >> 8; |
85 | | - requestId0_ = n & 0xFF; |
| 84 | + requestId1_ = (unsigned char) (n >> 8); |
| 85 | + requestId0_ = (unsigned char) (n & 0xFF); |
86 | 86 | } |
87 | 87 | }; |
88 | 88 | |
Index: trunk/tools/switchboard2/request_thread.cc |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | request_thread *req = static_cast<request_thread *>(arg); |
34 | 34 | try { |
35 | 35 | req->start_request(); |
36 | | - } catch (std::exception &e) { |
| 36 | + } catch (std::exception &) { |
37 | 37 | } |
38 | 38 | |
39 | 39 | delete req; |
Index: trunk/tools/switchboard2/main.cc |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | } |
151 | 151 | |
152 | 152 | pthread_t tid; |
153 | | - pthread_create(&tid, NULL, acceptor_thread, reinterpret_cast<void *>(lsnsock)); |
| 153 | + pthread_create(&tid, NULL, acceptor_thread, reinterpret_cast<void *>((intptr_t) lsnsock)); |
154 | 154 | } else { |
155 | 155 | int r; |
156 | 156 | struct addrinfo hints, *res, *iter; |
— | — | @@ -202,7 +202,7 @@ |
203 | 203 | } |
204 | 204 | |
205 | 205 | pthread_t tid; |
206 | | - pthread_create(&tid, NULL, acceptor_thread, reinterpret_cast<void *>(lsnsock)); |
| 206 | + pthread_create(&tid, NULL, acceptor_thread, reinterpret_cast<void *>((intptr_t) lsnsock)); |
207 | 207 | } |
208 | 208 | |
209 | 209 | freeaddrinfo(res); |