diff -r f600b0d1fc5d -r faab25d520dd bl/spawn.c --- a/bl/spawn.c Fri Jan 27 10:30:16 2012 +0000 +++ b/bl/spawn.c Fri Jan 27 16:18:02 2012 +0000 @@ -7,10 +7,10 @@ #define SPAWN_BUFSIZE 128 -boolean spawn_sync(char **argv,char **standard_output,int *exit_status) +gboolean spawn_sync(char **argv,char **standard_output,int *exit_status) { /* Don't use g_spawn_sync on WIN32 for now to avoid needing the helper */ -#if HAVE_GLIB && !defined(WIN32) +#ifndef WIN32 char *standard_error; GError *error=NULL; gboolean retval; @@ -33,41 +33,41 @@ FILE *fp; int i,r; size_t n,len; - String *command_line,*string; - command_line=string_new(NULL); + GString *command_line,*string; + command_line=g_string_new(NULL); for(i=0;argv[i];i++) { if (i) - string_append_c(command_line,' '); - string_append(command_line,argv[i]); + g_string_append_c(command_line,' '); + g_string_append(command_line,argv[i]); } fp=popen(command_line->str,"r"); - string_free(command_line,TRUE); + g_string_free(command_line,TRUE); if (!fp) { perror(command_line->str); return FALSE; } - string=string_new(NULL); + string=g_string_new(NULL); do { len=string->len; - string_set_size(string,len+SPAWN_BUFSIZE); + g_string_set_size(string,len+SPAWN_BUFSIZE); n=fread(string->str+len,1,SPAWN_BUFSIZE,fp); if (n<0) { perror("fread"); (void)pclose(fp); - string_free(string,TRUE); + g_string_free(string,TRUE); return FALSE; } - string_set_size(string,len+n); + g_string_set_size(string,len+n); } while(n); r=pclose(fp); if (r<0) { perror("pclose"); - string_free(string,TRUE); + g_string_free(string,TRUE); return FALSE; } else @@ -75,9 +75,9 @@ if (exit_status) *exit_status=r; if (standard_output) - *standard_output=string_free(string,FALSE); + *standard_output=g_string_free(string,FALSE); else - string_free(string,TRUE); + g_string_free(string,TRUE); return TRUE; } #endif