dovecot-1.2: master: If execv() fails with ENOMEM, mention the *...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Aug 24 20:13:51 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/366a327b028b
changeset: 9336:366a327b028b
user: Timo Sirainen <tss at iki.fi>
date: Mon Aug 24 13:13:45 2009 -0400
description:
master: If execv() fails with ENOMEM, mention the *_process_size setting.
diffstat:
7 files changed, 6 insertions(+), 13 deletions(-)
src/master/auth-process.c | 2 --
src/master/child-process.c | 4 +++-
src/master/child-process.h | 5 +++--
src/master/dict-process.c | 1 -
src/master/login-process.c | 2 --
src/master/mail-process.c | 4 ----
src/master/ssl-init.c | 1 -
diffs (103 lines):
diff -r a366666f4b50 -r 366a327b028b src/master/auth-process.c
--- a/src/master/auth-process.c Mon Aug 17 14:18:33 2009 -0400
+++ b/src/master/auth-process.c Mon Aug 24 13:13:45 2009 -0400
@@ -609,7 +609,6 @@ static int create_auth_process(struct au
executable = group->set->executable;
client_process_exec(executable, "");
- i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m", executable);
return -1;
}
@@ -675,7 +674,6 @@ static int create_auth_worker(struct aut
executable = t_strconcat(process->group->set->executable, " -w", NULL);
client_process_exec(executable, "");
- i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m", executable);
return -1;
}
diff -r a366666f4b50 -r 366a327b028b src/master/child-process.c
--- a/src/master/child-process.c Mon Aug 17 14:18:33 2009 -0400
+++ b/src/master/child-process.c Mon Aug 24 13:13:45 2009 -0400
@@ -87,7 +87,9 @@ void client_process_exec_argv(const char
p = strrchr(argv[0], '/');
if (p != NULL) argv[0] = p+1;
- execv(executable, (char **)argv);
+ (void)execv(executable, (char **)argv);
+ i_fatal_status(errno == ENOMEM ? FATAL_OUTOFMEM : FATAL_EXEC,
+ "execv(%s) failed: %m", executable);
}
static const char *get_exit_status_message(enum fatal_exit_status status,
diff -r a366666f4b50 -r 366a327b028b src/master/child-process.h
--- a/src/master/child-process.h Mon Aug 17 14:18:33 2009 -0400
+++ b/src/master/child-process.h Mon Aug 24 13:13:45 2009 -0400
@@ -33,8 +33,9 @@ void child_process_remove(pid_t pid);
void child_process_remove(pid_t pid);
void child_process_init_env(void);
-void client_process_exec(const char *cmd, const char *title);
-void client_process_exec_argv(const char *executable, const char **argv);
+void client_process_exec(const char *cmd, const char *title) ATTR_NORETURN;
+void client_process_exec_argv(const char *executable,
+ const char **argv) ATTR_NORETURN;
void child_process_set_destroy_callback(enum process_type type,
child_process_destroy_callback_t *cb);
diff -r a366666f4b50 -r 366a327b028b src/master/dict-process.c
--- a/src/master/dict-process.c Mon Aug 17 14:18:33 2009 -0400
+++ b/src/master/dict-process.c Mon Aug 24 13:13:45 2009 -0400
@@ -118,7 +118,6 @@ static int dict_process_create(struct di
executable = PKG_LIBEXECDIR"/dict";
client_process_exec(executable, "");
- i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m", executable);
return -1;
}
diff -r a366666f4b50 -r 366a327b028b src/master/login-process.c
--- a/src/master/login-process.c Mon Aug 17 14:18:33 2009 -0400
+++ b/src/master/login-process.c Mon Aug 24 13:13:45 2009 -0400
@@ -729,8 +729,6 @@ static pid_t create_login_process(struct
restrict_process_size(group->set->login_process_size, (unsigned int)-1);
client_process_exec(group->set->login_executable, "");
- i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m",
- group->set->login_executable);
return -1;
}
diff -r a366666f4b50 -r 366a327b028b src/master/mail-process.c
--- a/src/master/mail-process.c Mon Aug 17 14:18:33 2009 -0400
+++ b/src/master/mail-process.c Mon Aug 24 13:13:45 2009 -0400
@@ -524,8 +524,6 @@ void mail_process_exec(const char *proto
client_process_exec(executable, "");
else
client_process_exec_argv(executable, args);
-
- i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m", executable);
}
static void nfs_warn_if_found(const char *mail, const char *full_home_dir)
@@ -937,8 +935,6 @@ create_mail_process(enum process_type pr
}
client_process_exec(set->mail_executable, title);
- i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m",
- set->mail_executable);
/* not reached */
return MASTER_LOGIN_STATUS_INTERNAL_ERROR;
diff -r a366666f4b50 -r 366a327b028b src/master/ssl-init.c
--- a/src/master/ssl-init.c Mon Aug 17 14:18:33 2009 -0400
+++ b/src/master/ssl-init.c Mon Aug 24 13:13:45 2009 -0400
@@ -63,7 +63,6 @@ static void start_generate_process(const
child_process_init_env();
client_process_exec(t_strconcat(binpath, " "SSL_PARAMETERS_PERM_PATH,
NULL), "");
- i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m", binpath);
}
static void
More information about the dovecot-cvs
mailing list