return result;
GPid pid;
- gint stdout;
+ gint mystdout;
// geojson program should be on the $PATH
gchar **argv;
GError *error = NULL;
// TODO: monitor stderr?
- if (!g_spawn_async_with_pipes (NULL, argv, NULL, (GSpawnFlags) G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL, &stdout, NULL, &error)) {
+ if (!g_spawn_async_with_pipes (NULL, argv, NULL, (GSpawnFlags) G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL, &mystdout, NULL, &error)) {
if ( IS_VIK_WINDOW ((VikWindow *)VIK_GTK_WINDOW_FROM_LAYER(vtl)) ) {
gchar* msg = g_strdup_printf ( _("%s command failed: %s"), argv[0], error->message );
else {
// Probably should use GIOChannels...
gchar line[512];
- FILE *fout = fdopen(stdout, "r");
+ FILE *fout = fdopen(mystdout, "r");
setvbuf(fout, NULL, _IONBF, 0);
while (fgets(line, sizeof(line), fout)) {
- fprintf ( ff, line );
+ fprintf ( ff, "%s", line );
}
fclose(fout);
g_strfreev (argv);
// Delete the temporary file
- g_remove (tmp_filename);
+ (void)g_remove (tmp_filename);
g_free (tmp_filename);
return result;
g_debug ( "%s: temporary file = %s", __FUNCTION__, gpx_filename );
GPid pid;
- gint stdout;
+ gint mystdout;
// geojson program should be on the $PATH
gchar **argv;
FILE *gpxfile = fdopen (fd, "w");
// TODO: monitor stderr?
- if (!g_spawn_async_with_pipes (NULL, argv, NULL, (GSpawnFlags) G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL, &stdout, NULL, &error)) {
+ if (!g_spawn_async_with_pipes (NULL, argv, NULL, (GSpawnFlags) G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL, &mystdout, NULL, &error)) {
g_warning ("Async command failed: %s", error->message);
g_error_free(error);
}
else {
// Probably should use GIOChannels...
gchar line[512];
- FILE *fout = fdopen(stdout, "r");
+ FILE *fout = fdopen(mystdout, "r");
setvbuf(fout, NULL, _IONBF, 0);
while (fgets(line, sizeof(line), fout)) {
- fprintf ( gpxfile, line );
+ fprintf ( gpxfile, "%s", line );
}
fclose(fout);