diff --git a/config.h.in b/config.h.in index 191cef8..46e179d 100644 --- a/config.h.in +++ b/config.h.in @@ -87,6 +87,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H diff --git a/configure b/configure index cc75e04..b52f923 100755 --- a/configure +++ b/configure @@ -5694,7 +5694,7 @@ fi done -for ac_header in unistd.h syslog.h langinfo.h sys/statfs.h +for ac_header in unistd.h syslog.h langinfo.h sys/statfs.h sys/select.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/configure.ac b/configure.ac index cd4db9b..074a52d 100644 --- a/configure.ac +++ b/configure.ac @@ -68,7 +68,7 @@ AC_CHECK_HEADERS(sys/mount.h,,, #endif ]]) AC_CHECK_HEADERS(sys/ustat.h sys/sysmacros.h sys/syslog.h sys/socket.h) -AC_CHECK_HEADERS(unistd.h syslog.h langinfo.h sys/statfs.h) +AC_CHECK_HEADERS(unistd.h syslog.h langinfo.h sys/statfs.h sys/select.h) AC_CHECK_HEADERS(signum.h bits/signum.h, break ) AC_CHECK_HEADERS(stdarg.h varargs.h, break ) diff --git a/src/core/file.h b/src/core/file.h index a98f099..1964e31 100644 --- a/src/core/file.h +++ b/src/core/file.h @@ -143,8 +143,8 @@ public: }; -#if IS_AROS -class cArosPath +#if USES_DEVICE_PATH +class cDevicePath { public: static TSTRING AsPosix(const TSTRING& in); diff --git a/src/core/file_unix.cpp b/src/core/file_unix.cpp index 6a9225d..27b5b34 100644 --- a/src/core/file_unix.cpp +++ b/src/core/file_unix.cpp @@ -143,13 +143,13 @@ cFile::~cFile() // Open /////////////////////////////////////////////////////////////////////////////// -#ifndef __AROS +#if !USES_DEVICE_PATH void cFile::Open( const TSTRING& sFileName, uint32 flags ) { #else void cFile::Open( const TSTRING& sFileNameC, uint32 flags ) { - TSTRING sFileName = cArosPath::AsNative(sFileNameC); + TSTRING sFileName = cDevicePath::AsNative(sFileNameC); #endif mode_t openmode = 0664; if (mpData->mpCurrStream != NULL) @@ -458,30 +458,51 @@ void cFile::Truncate( File_t offset ) // throw(eFile) } -#if IS_AROS -TSTRING cArosPath::AsPosix( const TSTRING& in ) +#if USES_DEVICE_PATH +// For paths of type DH0:/dir/file +TSTRING cDevicePath::AsPosix( const TSTRING& in ) { if (in[0] == '/') return in; +#if IS_DOS_DJGPP + TSTRING out = "/dev/" + in; + std::replace(out.begin(), out.end(), '\\', '/'); +#else TSTRING out = '/' + in; +#endif + std::replace(out.begin(), out.end(), ':', '/'); return out; } -TSTRING cArosPath::AsNative( const TSTRING& in ) +TSTRING cDevicePath::AsNative( const TSTRING& in ) { if (in[0] != '/') return in; - int x; - for (x=1; in[x] == '/' && x= 8) + out.append(in.substr(7)); + + return out; + +#elif IS_AROS + int x = 1; + for ( x; in[x] == '/' && x &v, bool bFullPaths) const throw(eFSServices) { #else void cUnixFSServices::ReadDir(const TSTRING& strFilenameC, std::vector& v, bool bFullPaths) const throw(eFSServices) { - TSTRING strFilename = cArosPath::AsNative(strFilenameC); + TSTRING strFilename = cDevicePath::AsNative(strFilenameC); #endif //Get all the filenames @@ -326,13 +326,13 @@ void cUnixFSServices::SetTempDirName(TSTRING& tmpPath) { } -#if !IS_AROS +#if !USES_DEVICE_PATH void cUnixFSServices::Stat( const TSTRING& strName, cFSStatArgs &stat ) const throw(eFSServices) { #else void cUnixFSServices::Stat( const TSTRING& strNameC, cFSStatArgs& stat) const throw(eFSServices) { - TSTRING strName = cArosPath::AsNative(strNameC); + TSTRING strName = cDevicePath::AsNative(strNameC); #endif //local variable for obtaining info on file. struct stat statbuf; diff --git a/src/fs/fsparserutil.cpp b/src/fs/fsparserutil.cpp index 5ca28ea..c20ed44 100644 --- a/src/fs/fsparserutil.cpp +++ b/src/fs/fsparserutil.cpp @@ -137,8 +137,8 @@ void cFSParserUtil::InterpretFCOName( const std::list& l, cFCOName& nam for( std::list::const_iterator i = l.begin(); i != l.end(); i++ ) strT += *i; -#if IS_AROS - strT = cArosPath::AsPosix(strT); +#if USES_DEVICE_PATH + strT = cDevicePath::AsPosix(strT); #endif // let cFCOName handle interpretation diff --git a/src/tripwire/smtpmailmessage.cpp b/src/tripwire/smtpmailmessage.cpp index 472b098..046735c 100644 --- a/src/tripwire/smtpmailmessage.cpp +++ b/src/tripwire/smtpmailmessage.cpp @@ -56,7 +56,7 @@ #include #include -#if !IS_SORTIX +#if HAVE_SYS_SELECT_H # include #endif diff --git a/src/tripwire/twcmdline.cpp b/src/tripwire/twcmdline.cpp index fa02298..e6dc63d 100644 --- a/src/tripwire/twcmdline.cpp +++ b/src/tripwire/twcmdline.cpp @@ -311,8 +311,8 @@ static void FillOutConfigInfo(cTWModeCommon* pModeInfo, const cConfigFile& cf) // make sure it exists... // -#if IS_AROS - temp_directory = cArosPath::AsNative(temp_directory); +#if USES_DEVICE_PATH + temp_directory = cDevicePath::AsNative(temp_directory); #endif if (access(temp_directory.c_str(), F_OK) != 0) {