default:
// this goes against Unix98 docs so log it
- wxLogDebug(_T("unexpected kill(2) return value %d"), err);
+ wxLogDebug(wxT("unexpected kill(2) return value %d"), err);
// something else...
*rc = wxKILL_ERROR;
switch ( flags )
{
case wxSHUTDOWN_POWEROFF:
- level = _T('0');
+ level = wxT('0');
break;
case wxSHUTDOWN_REBOOT:
- level = _T('6');
+ level = wxT('6');
break;
case wxSHUTDOWN_LOGOFF:
return false;
default:
- wxFAIL_MSG( _T("unknown wxShutdown() flag") );
+ wxFAIL_MSG( wxT("unknown wxShutdown() flag") );
return false;
}
return false;
default:
- wxFAIL_MSG(_T("unexpected select() return value"));
+ wxFAIL_MSG(wxT("unexpected select() return value"));
// still fall through
case 1:
if ( !command )
{
// just an interactive shell
- cmd = _T("xterm");
+ cmd = wxT("xterm");
}
else
{
// execute command in a shell
- cmd << _T("/bin/sh -c '") << command << _T('\'');
+ cmd << wxT("/bin/sh -c '") << command << wxT('\'');
}
return cmd;
bool wxShell(const wxString& command, wxArrayString& output)
{
- wxCHECK_MSG( !command.empty(), false, _T("can't exec shell non interactively") );
+ wxCHECK_MSG( !command.empty(), false, wxT("can't exec shell non interactively") );
return wxExecute(wxMakeShellCommand(command), output);
}
// don't know what yet, so for now just warn the user (this is the least we
// can do) about it
wxASSERT_MSG( wxThread::IsMain(),
- _T("wxExecute() can be called only from the main thread") );
+ wxT("wxExecute() can be called only from the main thread") );
#endif // wxUSE_THREADS
#if defined(__WXCOCOA__) || ( defined(__WXOSX_MAC__) && wxOSX_USE_COCOA_OR_CARBON )
{
// save it for WaitForChild() use
execData.pid = pid;
+ if (execData.process)
+ execData.process->SetPid(pid); // and also in the wxProcess
// prepare for IO redirection
FILE *f = popen(cmd.ToAscii(), "r");
if ( !f )
{
- wxLogSysError(_T("Executing \"%s\" failed"), cmd.c_str());
+ wxLogSysError(wxT("Executing \"%s\" failed"), cmd.c_str());
return wxEmptyString;
}
pclose(f);
- if ( !s.empty() && s.Last() == _T('\n') )
+ if ( !s.empty() && s.Last() == wxT('\n') )
s.RemoveLast();
return s;
machine.Contains(wxT("alpha"));
}
+#ifdef __LINUX__
+wxLinuxDistributionInfo wxGetLinuxDistributionInfo()
+{
+ const wxString id = wxGetCommandOutput(wxT("lsb_release --id"));
+ const wxString desc = wxGetCommandOutput(wxT("lsb_release --description"));
+ const wxString rel = wxGetCommandOutput(wxT("lsb_release --release"));
+ const wxString codename = wxGetCommandOutput(wxT("lsb_release --codename"));
+
+ wxLinuxDistributionInfo ret;
+
+ id.StartsWith("Distributor ID:\t", &ret.Id);
+ desc.StartsWith("Description:\t", &ret.Description);
+ rel.StartsWith("Release:\t", &ret.Release);
+ codename.StartsWith("Codename:\t", &ret.CodeName);
+
+ return ret;
+}
+#endif
+
// these functions are in src/osx/utilsexc_base.cpp for wxMac
#ifndef __WXMAC__
#elif defined(HAVE_PUTENV)
wxString s = variable;
if ( value )
- s << _T('=') << value;
+ s << wxT('=') << value;
// transform to ANSI
const wxWX2MBbuf p = s.mb_str();
ok &= sigaction(SIGSEGV, &act, &s_handlerSEGV) == 0;
if ( !ok )
{
- wxLogDebug(_T("Failed to install our signal handler."));
+ wxLogDebug(wxT("Failed to install our signal handler."));
}
s_savedHandlers = true;
ok &= sigaction(SIGSEGV, &s_handlerSEGV, NULL) == 0;
if ( !ok )
{
- wxLogDebug(_T("Failed to uninstall our signal handler."));
+ wxLogDebug(wxT("Failed to uninstall our signal handler."));
}
s_savedHandlers = false;
}
//else: synchronous execution case
-#if HAS_PIPE_INPUT_STREAM
+#if HAS_PIPE_INPUT_STREAM && wxUSE_SOCKETS
wxProcess * const process = execData.process;
if ( process && process->IsRedirected() )
{