aboutsummaryrefslogtreecommitdiff
path: root/src/arm/gnunet-arm.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-09 10:05:42 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-09 10:05:42 +0000
commit2032baa561c7fefbe2605f5d6b979a295a61637d (patch)
tree2c2a2f1c92940a51ccb565c8fdc1b381a68d8bb4 /src/arm/gnunet-arm.c
parent0f6f7fdb0ee4172951f8cb1431d2e457a4b83716 (diff)
downloadgnunet-2032baa561c7fefbe2605f5d6b979a295a61637d.tar.gz
gnunet-2032baa561c7fefbe2605f5d6b979a295a61637d.zip
migrating towards XDG configuration specification (#3000)
Diffstat (limited to 'src/arm/gnunet-arm.c')
-rw-r--r--src/arm/gnunet-arm.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index 80d3e9c03..a492fac5b 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -147,7 +147,7 @@ static unsigned int no_stderr;
147 147
148 148
149/** 149/**
150 * Attempts to delete configuration file and SERVICEHOME 150 * Attempts to delete configuration file and GNUNET_HOME
151 * on ARM shutdown provided the end and delete options 151 * on ARM shutdown provided the end and delete options
152 * were specified when gnunet-arm was run. 152 * were specified when gnunet-arm was run.
153 */ 153 */
@@ -158,15 +158,17 @@ delete_files ()
158 "Will attempt to remove configuration file %s and service directory %s\n", 158 "Will attempt to remove configuration file %s and service directory %s\n",
159 config_file, dir); 159 config_file, dir);
160 160
161 if (UNLINK (config_file) != 0) 161 if (0 != UNLINK (config_file))
162 { 162 {
163 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 163 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
164 _("Failed to remove configuration file %s\n"), config_file); 164 _("Failed to remove configuration file %s\n"),
165 config_file);
165 } 166 }
166 if (GNUNET_DISK_directory_remove (dir) != GNUNET_OK) 167 if (GNUNET_OK != GNUNET_DISK_directory_remove (dir))
167 { 168 {
168 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 169 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
169 _("Failed to remove servicehome directory %s\n"), dir); 170 _("Failed to remove servicehome directory %s\n"),
171 dir);
170 172
171 } 173 }
172} 174}
@@ -192,8 +194,8 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
192 GNUNET_ARM_monitor_disconnect_and_free (m); 194 GNUNET_ARM_monitor_disconnect_and_free (m);
193 m = NULL; 195 m = NULL;
194 } 196 }
195 if ((end == GNUNET_YES) && (delete == GNUNET_YES)) 197 if ((GNUNET_YES == end) && (GNUNET_YES == delete))
196 delete_files (); 198 delete_files ();
197 GNUNET_CONFIGURATION_destroy (cfg); 199 GNUNET_CONFIGURATION_destroy (cfg);
198 cfg = NULL; 200 cfg = NULL;
199} 201}
@@ -588,7 +590,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
588 if (list) 590 if (list)
589 { 591 {
590 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 592 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
591 "Going to list all running services controlled by ARM.\n"); 593 "Going to list all running services controlled by ARM.\n");
592 GNUNET_ARM_request_service_list (h, 594 GNUNET_ARM_request_service_list (h,
593 (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout, 595 (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout,
594 &list_callback, &list); 596 &list_callback, &list);
@@ -673,10 +675,10 @@ run (void *cls,
673 cfg = GNUNET_CONFIGURATION_dup (c); 675 cfg = GNUNET_CONFIGURATION_dup (c);
674 config_file = cfgfile; 676 config_file = cfgfile;
675 if (GNUNET_OK != 677 if (GNUNET_OK !=
676 GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME", &dir)) 678 GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "GNUNET_HOME", &dir))
677 { 679 {
678 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, 680 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
679 "PATHS", "SERVICEHOME"); 681 "PATHS", "GNUNET_HOME");
680 return; 682 return;
681 } 683 }
682 if (NULL != cfgfile) 684 if (NULL != cfgfile)