MC Return has proposed merging
lp:~mc-return/upstart/upstart.merge-reduce-scopes-of-various-variables into
lp:upstart.
Requested reviews:
Upstart Reviewers (upstart-reviewers)
For more details, see:
https://code.launchpad.net/~mc-return/upstart/upstart.merge-reduce-scopes-of-various-variables/+merge/118890
Reduces the scope of various variables.
--
https://code.launchpad.net/~mc-return/upstart/upstart.merge-reduce-scopes-of-various-variables/+merge/118890
Your team Upstart Reviewers is requested to review the proposed merge of
lp:~mc-return/upstart/upstart.merge-reduce-scopes-of-various-variables into
lp:upstart.
=== modified file 'init/job_process.c'
--- init/job_process.c 2012-08-02 08:57:20 +0000
+++ init/job_process.c 2012-08-09 07:44:22 +0000
@@ -405,7 +405,6 @@
int pty_master = -1;
int pty_slave = -1;
char pts_name[PATH_MAX];
- char filename[PATH_MAX];
FILE *fd;
int user_job = FALSE;
nih_local char *user_dir = NULL;
@@ -783,6 +782,7 @@
*/
if (class->oom_score_adj != JOB_DEFAULT_OOM_SCORE_ADJ) {
int oom_value;
+ char filename[PATH_MAX];
snprintf (filename, sizeof (filename),
"/proc/%d/oom_score_adj", getpid ());
oom_value = class->oom_score_adj;
=== modified file 'init/log.c'
--- init/log.c 2012-03-16 21:06:11 +0000
+++ init/log.c 2012-08-09 07:44:22 +0000
@@ -208,9 +208,6 @@
static void
log_flush (Log *log)
{
- int ret;
- int flags;
-
nih_assert (log);
/* User job logging not currently available */
@@ -223,6 +220,7 @@
* If any failures occur at this stage, we are powerless.
*/
if (log->unflushed->len) {
+ int ret;
if (log_file_open (log) < 0)
goto out;
@@ -246,7 +244,7 @@
if (! log->remote_closed)
log_read_watch (log);
- flags = fcntl (log->io->watch->fd, F_GETFL);
+ int flags = fcntl (log->io->watch->fd, F_GETFL);
if (flags < 0 && errno == EBADF) {
/* The watch fd is now known to be invalid, so disable
=== modified file 'init/parse_job.c'
--- init/parse_job.c 2012-02-16 15:45:41 +0000
+++ init/parse_job.c 2012-08-09 07:44:22 +0000
@@ -1847,7 +1847,6 @@
nih_return_error (-1, PARSE_ILLEGAL_INTERVAL,
_(PARSE_ILLEGAL_INTERVAL_STR));
} else if (! strcmp (arg, "signal")) {
- unsigned long status;
nih_local char *sigarg = NULL;
int signal;
@@ -1865,7 +1864,7 @@
signal = nih_signal_from_name (sigarg);
if (signal < 0) {
errno = 0;
- status = strtoul (sigarg, &endptr, 10);
+ unsigned int status = strtoul (sigarg, &endptr, 10);
if (errno || *endptr || (status > INT_MAX))
nih_return_error (-1, PARSE_ILLEGAL_SIGNAL,
_(PARSE_ILLEGAL_SIGNAL_STR));
@@ -2285,7 +2284,6 @@
nih_local char *arg = NULL;
char *endptr;
size_t a_pos, a_lineno;
- int oom_adj;
int ret = -1;
nih_assert (class != NULL);
@@ -2328,7 +2326,7 @@
class->oom_score_adj = -1000;
} else {
errno = 0;
- oom_adj = (int)strtol (arg, &endptr, 10);
+ int oom_adj = (int)strtol (arg, &endptr, 10);
class->oom_score_adj = (oom_adj * 1000) / ((oom_adj < 0) ? 17 : 15);
if (errno || *endptr || (oom_adj < -17) || (oom_adj > 15))
nih_return_error (-1, PARSE_ILLEGAL_OOM,
=== modified file 'util/initctl.c'
--- util/initctl.c 2012-03-16 21:02:13 +0000
+++ util/initctl.c 2012-08-09 07:44:22 +0000
@@ -1331,7 +1331,6 @@
{
nih_local NihDBusProxy *upstart = NULL;
const char * upstart_job = NULL;
- const char * upstart_instance = NULL;
nih_local char * job_class_name = NULL;
nih_local char * job_class_path = NULL;
nih_local NihDBusProxy *job_class = NULL;
@@ -1346,6 +1345,7 @@
if (args[0]) {
upstart_job = args[0];
} else {
+ const char * upstart_instance = NULL;
upstart_job = getenv ("UPSTART_JOB");
upstart_instance = getenv ("UPSTART_INSTANCE");
--
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/upstart-devel