aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-10-13 07:44:31 +0000
committerChristian Grothoff <christian@grothoff.org>2016-10-13 07:44:31 +0000
commit9df183774b9b2b4cef897cb4f66240bb8c2198ec (patch)
tree8fa66ca66cd0b803cef007d9ff1f17f268f49f62
parent4c38f15697b338a770b3d1d499b45b2f009d6bf5 (diff)
downloadgnunet-9df183774b9b2b4cef897cb4f66240bb8c2198ec.tar.gz
gnunet-9df183774b9b2b4cef897cb4f66240bb8c2198ec.zip
fix build for Taler wallet
-rw-r--r--configure.ac9
-rw-r--r--po/POTFILES.in3
-rw-r--r--src/util/common_logging.c72
-rw-r--r--src/util/test_crypto_rsa.c4
4 files changed, 68 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac
index 6697db2c6..4453acff2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -567,7 +567,14 @@ AC_ARG_ENABLE([taler-wallet],
567 [taler_only=${enableval}], 567 [taler_only=${enableval}],
568 [taler_only=no]) 568 [taler_only=no])
569AC_MSG_RESULT($taler_only) 569AC_MSG_RESULT($taler_only)
570AM_CONDITIONAL([TALER_ONLY], [test "x$taler_only" = "xyes"]) 570if test "x$taler_only" = "xyes"
571then
572 AM_CONDITIONAL([TALER_ONLY],true)
573 AC_DEFINE([TALER_WALLET_ONLY],[1],[Compiling for Taler wallet])
574else
575 AM_CONDITIONAL([TALER_ONLY],false)
576 AC_DEFINE([TALER_WALLET_ONLY],[0],[Canonical compilation])
577fi
571 578
572# test for libextractor 579# test for libextractor
573extractor=0 580extractor=0
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 3fe957b95..adecca976 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -174,6 +174,7 @@ src/gns/gnunet-gns-proxy.c
174src/gns/gnunet-service-gns.c 174src/gns/gnunet-service-gns.c
175src/gns/gnunet-service-gns_interceptor.c 175src/gns/gnunet-service-gns_interceptor.c
176src/gns/gnunet-service-gns_resolver.c 176src/gns/gnunet-service-gns_resolver.c
177src/gns/gnunet-service-gns_reverser.c
177src/gns/gnunet-service-gns_shorten.c 178src/gns/gnunet-service-gns_shorten.c
178src/gns/nss/nss_gns.c 179src/gns/nss/nss_gns.c
179src/gns/nss/nss_gns_query.c 180src/gns/nss/nss_gns_query.c
@@ -271,6 +272,7 @@ src/psyc/gnunet-service-psyc.c
271src/psyc/psyc_api.c 272src/psyc/psyc_api.c
272src/psycstore/gnunet-service-psycstore.c 273src/psycstore/gnunet-service-psycstore.c
273src/psycstore/plugin_psycstore_mysql.c 274src/psycstore/plugin_psycstore_mysql.c
275src/psycstore/plugin_psycstore_postgres.c
274src/psycstore/plugin_psycstore_sqlite.c 276src/psycstore/plugin_psycstore_sqlite.c
275src/psycstore/psycstore_api.c 277src/psycstore/psycstore_api.c
276src/psycutil/psyc_env.c 278src/psycutil/psyc_env.c
@@ -412,6 +414,7 @@ src/tun/tun.c
412src/util/bandwidth.c 414src/util/bandwidth.c
413src/util/bio.c 415src/util/bio.c
414src/util/client.c 416src/util/client.c
417src/util/client_new.c
415src/util/common_allocation.c 418src/util/common_allocation.c
416src/util/common_endian.c 419src/util/common_endian.c
417src/util/common_logging.c 420src/util/common_logging.c
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index a391d0b9e..5989db00c 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -294,6 +294,7 @@ GNUNET_abort_ ()
294} 294}
295 295
296 296
297#if ! TALER_WALLET_ONLY
297/** 298/**
298 * Rotate logs, deleting the oldest log. 299 * Rotate logs, deleting the oldest log.
299 * 300 *
@@ -407,6 +408,7 @@ setup_log_file (const struct tm *tm)
407 GNUNET_stderr = altlog; 408 GNUNET_stderr = altlog;
408 return GNUNET_OK; 409 return GNUNET_OK;
409} 410}
411#endif
410 412
411 413
412/** 414/**
@@ -691,8 +693,6 @@ GNUNET_log_setup (const char *comp,
691 const char *logfile) 693 const char *logfile)
692{ 694{
693 const char *env_logfile; 695 const char *env_logfile;
694 const struct tm *tm;
695 time_t t;
696 696
697 min_level = get_type (loglevel); 697 min_level = get_type (loglevel);
698#if !defined(GNUNET_CULL_LOGGING) 698#if !defined(GNUNET_CULL_LOGGING)
@@ -715,9 +715,20 @@ GNUNET_log_setup (const char *comp,
715 log_file_name = GNUNET_STRINGS_filename_expand (logfile); 715 log_file_name = GNUNET_STRINGS_filename_expand (logfile);
716 if (NULL == log_file_name) 716 if (NULL == log_file_name)
717 return GNUNET_SYSERR; 717 return GNUNET_SYSERR;
718 t = time (NULL); 718#if TALER_WALLET_ONLY
719 tm = gmtime (&t); 719 /* log file option not allowed for wallet logic */
720 return setup_log_file (tm); 720 GNUNET_assert (NULL == logfile);
721 return GNUNET_OK;
722#else
723 {
724 time_t t;
725 const struct tm *tm;
726
727 t = time (NULL);
728 tm = gmtime (&t);
729 return setup_log_file (tm);
730 }
731#endif
721} 732}
722 733
723 734
@@ -806,7 +817,7 @@ output_message (enum GNUNET_ErrorType kind,
806 * for end users while still having the power of the 817 * for end users while still having the power of the
807 * logging engine for developer needs. So ideally this 818 * logging engine for developer needs. So ideally this
808 * is what it should look like when CLI tools are used 819 * is what it should look like when CLI tools are used
809 * interactively, yet the same message shouldn't look 820 * interactively, yet the same message shouldn't look
810 * this way if the output is going to logfiles or robots 821 * this way if the output is going to logfiles or robots
811 * instead. Is this the right place to do this? --lynX 822 * instead. Is this the right place to do this? --lynX
812 */ 823 */
@@ -848,7 +859,8 @@ flush_bulk (const char *datestr)
848 char *last; 859 char *last;
849 const char *ft; 860 const char *ft;
850 861
851 if ((0 == last_bulk_time.abs_value_us) || (0 == last_bulk_repeat)) 862 if ( (0 == last_bulk_time.abs_value_us) ||
863 (0 == last_bulk_repeat) )
852 return; 864 return;
853 rev = 0; 865 rev = 0;
854 last = memchr (last_bulk, '\0', BULK_TRACK_SIZE); 866 last = memchr (last_bulk, '\0', BULK_TRACK_SIZE);
@@ -933,10 +945,15 @@ mylog (enum GNUNET_ErrorType kind,
933 va_list vacp; 945 va_list vacp;
934 946
935 va_copy (vacp, va); 947 va_copy (vacp, va);
936 size = VSNPRINTF (NULL, 0, message, vacp) + 1; 948 size = VSNPRINTF (NULL,
949 0,
950 message,
951 vacp) + 1;
937 GNUNET_assert (0 != size); 952 GNUNET_assert (0 != size);
938 va_end (vacp); 953 va_end (vacp);
939 memset (date, 0, DATE_STR_SIZE); 954 memset (date,
955 0,
956 DATE_STR_SIZE);
940 { 957 {
941 char buf[size]; 958 char buf[size];
942 long long offset; 959 long long offset;
@@ -956,8 +973,13 @@ mylog (enum GNUNET_ErrorType kind,
956 } 973 }
957 else 974 else
958 { 975 {
959 strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%020llu", tmptr); 976 strftime (date2,
960 snprintf (date, sizeof (date), date2, 977 DATE_STR_SIZE,
978 "%b %d %H:%M:%S-%%020llu",
979 tmptr);
980 snprintf (date,
981 sizeof (date),
982 date2,
961 (long long) (pc.QuadPart / 983 (long long) (pc.QuadPart /
962 (performance_frequency.QuadPart / 1000))); 984 (performance_frequency.QuadPart / 1000)));
963 } 985 }
@@ -992,17 +1014,26 @@ mylog (enum GNUNET_ErrorType kind,
992 tmptr = localtime (&timeofday.tv_sec); 1014 tmptr = localtime (&timeofday.tv_sec);
993 if (NULL == tmptr) 1015 if (NULL == tmptr)
994 { 1016 {
995 strcpy (date, "localtime error"); 1017 strcpy (date,
1018 "localtime error");
996 } 1019 }
997 else 1020 else
998 { 1021 {
999 strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%06u", tmptr); 1022 strftime (date2,
1000 snprintf (date, sizeof (date), date2, timeofday.tv_usec); 1023 DATE_STR_SIZE,
1024 "%b %d %H:%M:%S-%%06u",
1025 tmptr);
1026 snprintf (date,
1027 sizeof (date),
1028 date2,
1029 timeofday.tv_usec);
1001 } 1030 }
1002#endif 1031#endif
1003 VSNPRINTF (buf, size, message, va); 1032 VSNPRINTF (buf, size, message, va);
1033#if ! TALER_WALLET_ONLY
1004 if (NULL != tmptr) 1034 if (NULL != tmptr)
1005 (void) setup_log_file (tmptr); 1035 (void) setup_log_file (tmptr);
1036#endif
1006 if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && 1037 if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) &&
1007 (0 != last_bulk_time.abs_value_us) && 1038 (0 != last_bulk_time.abs_value_us) &&
1008 (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) 1039 (0 == strncmp (buf, last_bulk, sizeof (last_bulk))))
@@ -1015,12 +1046,19 @@ mylog (enum GNUNET_ErrorType kind,
1015 return; 1046 return;
1016 } 1047 }
1017 flush_bulk (date); 1048 flush_bulk (date);
1018 strncpy (last_bulk, buf, sizeof (last_bulk)); 1049 strncpy (last_bulk,
1050 buf,
1051 sizeof (last_bulk));
1019 last_bulk_repeat = 0; 1052 last_bulk_repeat = 0;
1020 last_bulk_kind = kind; 1053 last_bulk_kind = kind;
1021 last_bulk_time = GNUNET_TIME_absolute_get (); 1054 last_bulk_time = GNUNET_TIME_absolute_get ();
1022 strncpy (last_bulk_comp, comp, COMP_TRACK_SIZE); 1055 strncpy (last_bulk_comp,
1023 output_message (kind, comp, date, buf); 1056 comp,
1057 COMP_TRACK_SIZE);
1058 output_message (kind,
1059 comp,
1060 date,
1061 buf);
1024 } 1062 }
1025} 1063}
1026 1064
diff --git a/src/util/test_crypto_rsa.c b/src/util/test_crypto_rsa.c
index 489dc2cf1..c64c0acf9 100644
--- a/src/util/test_crypto_rsa.c
+++ b/src/util/test_crypto_rsa.c
@@ -11,7 +11,7 @@
11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 12
13 You should have received a copy of the GNU General Public License along with 13 You should have received a copy of the GNU General Public License along with
14 TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> 14 GNUnet; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
15*/ 15*/
16 16
17/** 17/**
@@ -112,7 +112,7 @@ main (int argc,
112 pub); 112 pub);
113 GNUNET_CRYPTO_rsa_signature_free (bsig); 113 GNUNET_CRYPTO_rsa_signature_free (bsig);
114 GNUNET_assert (GNUNET_OK == 114 GNUNET_assert (GNUNET_OK ==
115 GNUNET_CRYPTO_rsa_verify (&hash, sig, pub)); 115 GNUNET_CRYPTO_rsa_verify (&hash, sig, pub));
116 GNUNET_CRYPTO_rsa_signature_free (sig); 116 GNUNET_CRYPTO_rsa_signature_free (sig);
117 GNUNET_CRYPTO_rsa_signature_free (sig_copy); 117 GNUNET_CRYPTO_rsa_signature_free (sig_copy);
118 GNUNET_CRYPTO_rsa_private_key_free (priv); 118 GNUNET_CRYPTO_rsa_private_key_free (priv);