Diff of /trunk/src/geotoad.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 208 by harbaum, Tue Nov 24 15:21:22 2009 UTC revision 210 by harbaum, Tue Nov 24 20:19:08 2009 UTC
# Line 219  static FILE *gt_popen(gt_context_t *cont Line 219  static FILE *gt_popen(gt_context_t *cont
219    
220      /* this printf will actually be redirected through the pipe */      /* this printf will actually be redirected through the pipe */
221      printf("Error: Failed to execute!\n");      printf("Error: Failed to execute!\n");
222      context_free(context);      exit(1);
     exit(0);  
223    } else {         /* we're having major problems... */    } else {         /* we're having major problems... */
224      close(p[0]);      close(p[0]);
225      close(p[1]);      close(p[1]);
# Line 278  static gpointer thread_worker(gt_context Line 277  static gpointer thread_worker(gt_context
277    pclose(fh);    pclose(fh);
278    append_parentf(context, COLOR_SYSTEM, "Job done!");    append_parentf(context, COLOR_SYSTEM, "Job done!");
279    
   /* TODO: this happens on the copy!!!! */;  
   printf("client context free = %d\n", context->use_cnt);  
280    context_free(context);    context_free(context);
281    
282    //  g_thread_exit(NULL);    g_thread_exit(NULL);
283    return NULL;    return NULL;
284  }  }
285    
# Line 300  static void run(gt_context_t *context) { Line 297  static void run(gt_context_t *context) {
297    
298    /* build list of arguments to call geotoad */    /* build list of arguments to call geotoad */
299    context->argv = g_ptr_array_new();    context->argv = g_ptr_array_new();
300    g_ptr_array_add (context->argv, g_strdup_printf(GEOTOAD "a"));    g_ptr_array_add (context->argv, g_strdup_printf(GEOTOAD));
301    g_ascii_dtostr(str, sizeof(str), context->appdata->gt.distance);    g_ascii_dtostr(str, sizeof(str), context->appdata->gt.distance);
302    g_ptr_array_add (context->argv, g_strdup_printf("--distanceMax=%s", str));    g_ptr_array_add (context->argv,
303    g_ptr_array_add (context->argv, g_strdup_printf("--output=%s", context->appdata->gt.filename));               g_strdup_printf("--distanceMax=%s", str));
304    g_ptr_array_add (context->argv, g_strdup_printf("--password=%s", context->appdata->gt.password));    g_ptr_array_add (context->argv,
305    g_ptr_array_add (context->argv, g_strdup_printf("--queryType=coord"));               g_strdup_printf("--output=%s", context->appdata->gt.filename));
306    g_ptr_array_add (context->argv, g_strdup_printf("--user=%s", context->appdata->username));    g_ptr_array_add (context->argv,
307                 g_strdup_printf("--password=%s", context->appdata->gt.password));
308      g_ptr_array_add (context->argv,
309                 g_strdup_printf("--queryType=coord"));
310      g_ptr_array_add (context->argv,
311                 g_strdup_printf("--user=%s", context->appdata->username));
312    
313    /* check if we need to add proxy config */    /* check if we need to add proxy config */
314    char *proxy = NULL;    char *proxy = NULL;
# Line 342  static void run(gt_context_t *context) { Line 344  static void run(gt_context_t *context) {
344             n, (int)lat_int, (int)lat_mint, (int)(lat_frac*1000.0+0.5),             n, (int)lat_int, (int)lat_mint, (int)(lat_frac*1000.0+0.5),
345             e, (int)lon_int, (int)lon_mint, (int)(lon_frac*1000.0+0.5)));             e, (int)lon_int, (int)lon_mint, (int)(lon_frac*1000.0+0.5)));
346    
   //  g_ptr_array_add (context->argv, g_strdup_printf("2>&1"));  
347    g_ptr_array_add (context->argv, NULL);    g_ptr_array_add (context->argv, NULL);
348    
349    /* show all entries */    /* show all entries */

Legend:
Removed from v.208  
changed lines
  Added in v.210