dovecot-2.0: ssl-params: When generating parameters, run the pro...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Oct 23 02:13:41 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/0893112306d1
changeset: 10140:0893112306d1
user: Timo Sirainen <tss at iki.fi>
date: Thu Oct 22 19:12:27 2009 -0400
description:
ssl-params: When generating parameters, run the process with priority +15.
diffstat:
1 file changed, 12 insertions(+), 1 deletion(-)
src/ssl-params/ssl-params.c | 13 ++++++++++++-
diffs (35 lines):
diff -r 38c307c7af2a -r 0893112306d1 src/ssl-params/ssl-params.c
--- a/src/ssl-params/ssl-params.c Thu Oct 22 19:11:14 2009 -0400
+++ b/src/ssl-params/ssl-params.c Thu Oct 22 19:12:27 2009 -0400
@@ -11,12 +11,18 @@
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
#define MAX_PARAM_FILE_SIZE 1024
#define SSL_BUILD_PARAM_TIMEOUT_SECS (60*30)
+#define SSL_PARAMS_PRIORITY 15
struct ssl_params {
char *path;
@@ -34,6 +40,11 @@ static void ssl_params_if_unchanged(cons
struct stat st, st2;
mode_t old_mask;
int fd, ret;
+
+#ifdef HAVE_SETPRIORITY
+ if (setpriority(PRIO_PROCESS, 0, SSL_PARAMS_PRIORITY) < 0)
+ i_error("setpriority(%d) failed: %m", SSL_PARAMS_PRIORITY);
+#endif
temp_path = t_strconcat(path, ".tmp", NULL);
More information about the dovecot-cvs
mailing list