};
#endif // Unices without usleep()
+#ifdef __EMX__
+ /* I copied this from the XFree86 diffs. AV. */
+extern void DosSleep(unsigned long);
+#define INCL_DOSPROCESS
+#include <os2.h>
+void usleep(unsigned long delay)
+{
+ DosSleep(delay ? (delay/1000l) : 1l);
+}
+#endif
+
// ============================================================================
// implementation
// ============================================================================
char *mb_argv[WXEXECUTE_NARGS];
while (argv[mb_argc]) {
- wxWX2MBbuf mb_arg = wxConv_libc.cWX2MB(argv[mb_argc]);
+ wxWX2MBbuf mb_arg = wxConvCurrent->cWX2MB(argv[mb_argc]);
mb_argv[mb_argc] = strdup(mb_arg);
mb_argc++;
}
if (pipe(end_proc_detect) == -1)
{
wxLogSysError( _("Pipe creation failed") );
+#if wxUSE_UNICODE
+ mb_argc = 0;
+ while (mb_argv[mb_argc])
+ free(mb_argv[mb_argc++]);
+#endif
return 0;
}
// fork the process
-#ifdef HAVE_VFORK
+#if HAVE_VFORK
pid_t pid = vfork();
#else
pid_t pid = fork();
if (pid == -1)
{
wxLogSysError( _("Fork failed") );
+#if wxUSE_UNICODE
+ mb_argc = 0;
+ while (mb_argv[mb_argc])
+ free(mb_argv[mb_argc++]);
+#endif
return 0;
}
else if (pid == 0)
}
if ((ptr = wxGetenv(_T("USER"))) != NULL || (ptr = wxGetenv(_T("LOGNAME"))) != NULL)
{
- who = getpwnam(wxConv_libc.cWX2MB(ptr));
+ who = getpwnam(wxConvCurrent->cWX2MB(ptr));
}
// We now make sure the the user exists!
}
#if wxUSE_UNICODE
- return who ? wxConv_libc.cMB2WX(who->pw_dir) : (wxMB2WXbuf)((wxChar*)NULL);
+ return who ? wxConvCurrent->cMB2WX(who->pw_dir) : (wxMB2WXbuf)((wxChar*)NULL);
#else
return who ? who->pw_dir : ((char*)NULL);
#endif
bool ok = uname(&uts) != -1;
if ( ok )
{
- wxStrncpy(buf, wxConv_libc.cMB2WX(uts.nodename), sz - 1);
+ wxStrncpy(buf, wxConvCurrent->cMB2WX(uts.nodename), sz - 1);
buf[sz] = _T('\0');
}
#elif defined(HAVE_GETHOSTNAME)
{
if ( !wxStrchr(buf, _T('.')) )
{
- struct hostent *host = gethostbyname(wxConv_libc.cWX2MB(buf));
+ struct hostent *host = gethostbyname(wxConvCurrent->cWX2MB(buf));
if ( !host )
{
wxLogSysError(_("Cannot get the official hostname"));
else
{
// the canonical name
- wxStrncpy(buf, wxConv_libc.cMB2WX(host->h_name), sz);
+ wxStrncpy(buf, wxConvCurrent->cMB2WX(host->h_name), sz);
}
}
//else: it's already a FQDN (BSD behaves this way)
*buf = _T('\0');
if ((who = getpwuid(getuid ())) != NULL)
{
- wxStrncpy (buf, wxConv_libc.cMB2WX(who->pw_name), sz - 1);
+ wxStrncpy (buf, wxConvCurrent->cMB2WX(who->pw_name), sz - 1);
return TRUE;
}
comma = strchr(who->pw_gecos, ',');
if (comma)
*comma = '\0'; // cut off non-name comment fields
- wxStrncpy (buf, wxConv_libc.cMB2WX(who->pw_gecos), sz - 1);
+ wxStrncpy (buf, wxConvCurrent->cMB2WX(who->pw_gecos), sz - 1);
return TRUE;
}