X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6de97a3b945c99fb942209df48be26f43c1b436d..8fdca65cf20ae4dba861fa6667d6e233cbb900cf:/src/gtk/utilsgtk.cpp?ds=inline diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index 3fdfdfde0f..25210a4e0b 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -80,20 +80,16 @@ int wxDisplayDepth(void) // user and home routines //------------------------------------------------------------------------ -char* wxGetHomeDir( char *dest ) +const char* wxGetHomeDir( wxString *home ) { - wxString tmp = wxGetUserHome( wxString() ); - if (tmp.IsNull()) - strcpy( wxBuffer, "/" ); - else - strcpy( wxBuffer, tmp ); - if (dest) strcpy( dest, WXSTRINGCAST tmp ); - return wxBuffer; + *home = wxGetUserHome( wxString() ); + if (home->IsNull()) *home = "/"; + return *home; }; char *wxGetUserHome( const wxString &user ) { - struct passwd *who = NULL; + struct passwd *who = (struct passwd *) NULL; if (user.IsNull() || (user== "")) { @@ -375,7 +371,14 @@ static void GTK_EndProcessDetector(gpointer data, gint source, pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid); + /* wait4 is not part of any standard, use at own risk + * not sure what wait4 does, but wait3 seems to be closest, whats a digit ;-) + * --- offer@sgi.com */ +#if !defined(__sgi) wait4(proc_data->pid, NULL, 0, NULL); +#else + wait3((int *) NULL, 0, (rusage *) NULL); +#endif close(source); gdk_input_remove(proc_data->tag); @@ -437,7 +440,7 @@ long wxExecute( char **argv, bool sync, wxProcess *process ) if (!sync) { data->process = process; } else { - data->process = NULL; + data->process = (wxProcess *) NULL; data->pid = -(data->pid); while (data->pid != 0) @@ -461,7 +464,7 @@ long wxExecute( const wxString& command, bool sync, wxProcess *process ) strncpy (tmp, command, sizeof(tmp) / sizeof(char) - 1); tmp[sizeof (tmp) / sizeof (char) - 1] = '\0'; argv[argc++] = strtok (tmp, IFS); - while ((argv[argc++] = strtok(NULL, IFS)) != NULL) + while ((argv[argc++] = strtok((char *) NULL, IFS)) != NULL) /* loop */ ; return wxExecute(argv, sync, process); };