chiark / gitweb /
gcrypt initialization to suppress warning message. Not really
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 8 Mar 2009 13:34:33 +0000 (13:34 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 8 Mar 2009 13:34:33 +0000 (13:34 +0000)
anything to do with the uaudio branch as such but found here and
fixing it here will likely save a conflict when we merge.

clients/disorder.c
disobedience/disobedience.c
server/disorderd.c
server/speaker.c

index 8dc6d7fda7f35baa96bc38f0c78ddbbc1a93f13f..5f725e8180ad93200abaf4920e38f12dbac6bd0a 100644 (file)
@@ -32,6 +32,7 @@
 #include <unistd.h>
 #include <pcre.h>
 #include <ctype.h>
+#include <gcrypt.h>
 
 #include "configuration.h"
 #include "syscalls.h"
@@ -764,6 +765,11 @@ int main(int argc, char **argv) {
     config->connect.n = 0;
   n = optind;
   optind = 1;                          /* for subsequent getopt calls */
+  /* gcrypt initialization */
+  if(!gcry_check_version(NULL))
+    disorder_fatal(0, "gcry_check_version failed");
+  gcry_control(GCRYCTL_INIT_SECMEM, 0);
+  gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
   /* accumulate command args */
   while(n < argc) {
     if((i = TABLE_FIND(commands, name, argv[n])) < 0)
index e0fa295bbb0185a9e078bf4adc86cf2cbac2baa5..dea9d59276b0bc65a587a2f7120ef59bd66a4a37 100644 (file)
@@ -25,6 +25,7 @@
 #include <getopt.h>
 #include <locale.h>
 #include <pcre.h>
+#include <gcrypt.h>
 
 /* Apologies for the numerous de-consting casts, but GLib et al do not seem to
  * have heard of const. */
@@ -448,6 +449,11 @@ int main(int argc, char **argv) {
   }
   if(!gtkok)
     fatal(0, "failed to initialize GTK+");
+  /* gcrypt initialization */
+  if(!gcry_check_version(NULL))
+    disorder_fatal(0, "gcry_check_version failed");
+  gcry_control(GCRYCTL_INIT_SECMEM, 0);
+  gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
   signal(SIGPIPE, SIG_IGN);
   init_styles();
   load_settings();
index 72a8e3d918cbd97333c8c03fab0b83fcf856679d..74fc07eb4a7d3c49059b3d54d5383f56d6f0d944 100644 (file)
@@ -209,7 +209,10 @@ int main(int argc, char **argv) {
   fix_path();
   srand(time(0));                      /* don't start the same every time */
   /* gcrypt initialization */
+  if(!gcry_check_version(NULL))
+    disorder_fatal(0, "gcry_check_version failed");
   gcry_control(GCRYCTL_INIT_SECMEM, 1);
+  gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
   /* make sure we can't have more than FD_SETSIZE files open (event.c does
    * check but this provides an additional line of defence) */
   if(getrlimit(RLIMIT_NOFILE, rl) < 0)
index 123f7a20a60eb1a688b7cf8966ce68417e9c1b7d..cc1764ed464f11fc1ba526f1abb5a81ac7173686 100644 (file)
@@ -80,6 +80,7 @@
 #include <sys/stat.h>
 #include <pthread.h>
 #include <sys/resource.h>
+#include <gcrypt.h>
 
 #include "configuration.h"
 #include "syscalls.h"
@@ -652,6 +653,11 @@ int main(int argc, char **argv) {
     info("set RLIM_NOFILE to %lu", (unsigned long)rl->rlim_cur);
   } else
     info("RLIM_NOFILE is %lu", (unsigned long)rl->rlim_cur);
+  /* gcrypt initialization */
+  if(!gcry_check_version(NULL))
+    disorder_fatal(0, "gcry_check_version failed");
+  gcry_control(GCRYCTL_INIT_SECMEM, 0);
+  gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
   /* create a pipe between the backend callback and the poll() loop */
   xpipe(sigpipe);
   nonblock(sigpipe[0]);