]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
Oops, don't cut and paste between ports, and do test compile both states
[wxWidgets.git] / src / unix / utilsunx.cpp
index 6ff5e309846c2ad6bd7faac8c834a84c379f8fe9..59fb259624eed275f99847dd06d82854c65eb2d7 100644 (file)
     #include <sys/statvfs.h>
 
     #define statfs statvfs
+# ifdef __HPUX__
+    #define wxStatFs struct statvfs
+# else
     #define wxStatFs statvfs_t
+# endif
 #elif HAVE_STATFS
     #define wxStatFs struct statfs
 #endif // HAVE_STAT[V]FS
@@ -253,11 +257,7 @@ long wxExecute( const wxString& command, int flags, wxProcess *process )
     argv[argc] = NULL;
 
     // do execute the command
-#if wxUSE_UNICODE
-    long lRc = -1;
-#else
     long lRc = wxExecute(argv, flags, process);
-#endif
 
     // clean up
     argc = 0;
@@ -366,10 +366,10 @@ public:
     bool IsOpened() const { return !Eof(); }
 
     // return TRUE if we have anything to read, don't block
-    bool IsAvailable() const;
+    virtual bool CanRead() const;
 };
 
-bool wxPipeInputStream::IsAvailable() const
+bool wxPipeInputStream::CanRead() const
 {
     if ( m_lasterror == wxSTREAM_EOF )
         return FALSE;
@@ -563,13 +563,17 @@ long wxExecute(wxChar **argv,
     }
 
     // fork the process
-#ifdef HAVE_VFORK
-    pid_t pid = vfork();
+    //
+    // NB: do *not* use vfork() here, it completely breaks this code for some
+    //     reason under Solaris (and maybe others, although not under Linux)
+    //     But on OpenVMS we do not have fork so we have to use vfork and
+    //     cross our fingers that it works.
+#ifdef __VMS
+   pid_t pid = vfork();
 #else
-    pid_t pid = fork();
+   pid_t pid = fork();
 #endif
-
-    if ( pid == -1 )     // error?
+   if ( pid == -1 )     // error?
     {
         wxLogSysError( _("Fork failed") );
 
@@ -800,7 +804,12 @@ char *wxGetUserHome( const wxString &user )
 
         if ((ptr = wxGetenv(wxT("HOME"))) != NULL)
         {
+#if wxUSE_UNICODE
+            wxWCharBuffer buffer( ptr );
+            return buffer;
+#else
             return ptr;
+#endif
         }
         if ((ptr = wxGetenv(wxT("USER"))) != NULL || (ptr = wxGetenv(wxT("LOGNAME"))) != NULL)
         {
@@ -947,7 +956,7 @@ wxString wxGetOsDescription()
 #ifndef WXWIN_OS_DESCRIPTION
     #error WXWIN_OS_DESCRIPTION should be defined in config.h by configure
 #else
-    return WXWIN_OS_DESCRIPTION;
+    return wxString::FromAscii( WXWIN_OS_DESCRIPTION );
 #endif
 }
 #endif