Timothy Pearson 10 years ago
commit 03518d6339

@ -181,6 +181,12 @@ check_include_file( "mntent.h" HAVE_MNTENT_H )
check_include_file( "ndir.h" HAVE_NDIR_H ) check_include_file( "ndir.h" HAVE_NDIR_H )
check_include_file( "netinet/in.h" HAVE_NETINET_IN_H ) check_include_file( "netinet/in.h" HAVE_NETINET_IN_H )
check_include_file( "net/if.h" HAVE_NET_IF_H ) check_include_file( "net/if.h" HAVE_NET_IF_H )
if( NOT HAVE_NET_IF_H )
find_path( NET_IF_PATH "net/if.h" )
if( NET_IF_PATH )
set( HAVE_NET_IF_H "1" )
endif( )
endif( )
check_include_file( "paths.h" HAVE_PATHS_H ) check_include_file( "paths.h" HAVE_PATHS_H )
check_include_file( "pty.h" HAVE_PTY_H ) check_include_file( "pty.h" HAVE_PTY_H )
check_include_file( "stdint.h" HAVE_STDINT_H ) check_include_file( "stdint.h" HAVE_STDINT_H )
@ -197,6 +203,12 @@ check_include_file( "sys/mman.h" HAVE_SYS_MMAN_H )
check_include_file( "sys/mntent.h" HAVE_SYS_MNTENT_H ) check_include_file( "sys/mntent.h" HAVE_SYS_MNTENT_H )
check_include_file( "sys/mnttab.h" HAVE_SYS_MNTTAB_H ) check_include_file( "sys/mnttab.h" HAVE_SYS_MNTTAB_H )
check_include_file( "sys/mount.h" HAVE_SYS_MOUNT_H ) check_include_file( "sys/mount.h" HAVE_SYS_MOUNT_H )
if( NOT HAVE_SYS_MOUNT_H )
find_path( SYS_MOUNT_PATH "sys/mount.h" )
if( SYS_MOUNT_PATH )
set( HAVE_SYS_MOUNT_H "1" )
endif( )
endif( )
check_include_file( "sys/ndir.h" HAVE_SYS_NDIR_H ) check_include_file( "sys/ndir.h" HAVE_SYS_NDIR_H )
check_include_file( "sys/param.h" HAVE_SYS_PARAM_H ) check_include_file( "sys/param.h" HAVE_SYS_PARAM_H )
check_include_file( "sys/prctl.h" HAVE_SYS_PRCTL_H ) check_include_file( "sys/prctl.h" HAVE_SYS_PRCTL_H )
@ -206,6 +218,12 @@ check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
check_include_file( "sys/stropts.h" HAVE_SYS_STROPTS_H ) check_include_file( "sys/stropts.h" HAVE_SYS_STROPTS_H )
check_include_file( "sys/types.h" HAVE_SYS_TYPES_H ) check_include_file( "sys/types.h" HAVE_SYS_TYPES_H )
check_include_file( "sys/ucred.h" HAVE_SYS_UCRED_H ) check_include_file( "sys/ucred.h" HAVE_SYS_UCRED_H )
if( NOT HAVE_SYS_UCRED_H )
find_path( SYS_UCRED_PATH "sys/ucred.h" )
if( SYS_UCRED_PATH )
set( HAVE_SYS_UCRED_H "1" )
endif( )
endif( )
check_include_file( "sys/xattr.h" HAVE_SYS_XATTR_H ) check_include_file( "sys/xattr.h" HAVE_SYS_XATTR_H )
check_include_file( "termios.h" HAVE_TERMIOS_H ) check_include_file( "termios.h" HAVE_TERMIOS_H )
check_include_file( "termio.h" HAVE_TERMIO_H ) check_include_file( "termio.h" HAVE_TERMIO_H )
@ -263,7 +281,7 @@ check_function_exists( mkstemps HAVE_MKSTEMPS )
check_symbol_exists( mkstemps "stdlib.h" HAVE_MKSTEMPS_PROTO ) check_symbol_exists( mkstemps "stdlib.h" HAVE_MKSTEMPS_PROTO )
check_function_exists( initgroups HAVE_INITGROUPS ) check_function_exists( initgroups HAVE_INITGROUPS )
check_symbol_exists( initgroups "grp.h" HAVE_INITGROUPS_PROTO ) check_symbol_exists( initgroups "grp.h;unistd.h" HAVE_INITGROUPS_PROTO )
check_function_exists( strlcat HAVE_STRLCAT ) check_function_exists( strlcat HAVE_STRLCAT )
check_symbol_exists( strlcat "string.h" HAVE_STRLCAT_PROTO ) check_symbol_exists( strlcat "string.h" HAVE_STRLCAT_PROTO )
@ -305,6 +323,9 @@ if (HAVE_ALLOCA_H )
else (HAVE_ALLOCA_H ) else (HAVE_ALLOCA_H )
check_symbol_exists( alloca "stdlib.h" HAVE_ALLOCA ) check_symbol_exists( alloca "stdlib.h" HAVE_ALLOCA )
endif (HAVE_ALLOCA_H ) endif (HAVE_ALLOCA_H )
if( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" )
set( HAVE_ALLOCA 1 )
endif( )
check_function_exists( getmntinfo HAVE_GETMNTINFO ) check_function_exists( getmntinfo HAVE_GETMNTINFO )
check_function_exists( getnameinfo HAVE_GETNAMEINFO ) check_function_exists( getnameinfo HAVE_GETNAMEINFO )
@ -475,10 +496,15 @@ set( kde_socklen_t socklen_t )
##### check for libdl ########################### ##### check for libdl ###########################
find_library( HAVE_LIBDL dl ) set( DL_LIBRARIES dl )
if( NOT HAVE_LIBDL-NOTFOUND ) check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL )
set( DL_LIBRARIES dl ) if( NOT HAVE_LIBDL )
endif( NOT HAVE_LIBDL-NOTFOUND ) unset( DL_LIBRARIES )
check_function_exists( dlopen HAVE_DLOPEN )
if( HAVE_DLOPEN )
set( HAVE_LIBDL 1 )
endif( HAVE_DLOPEN )
endif( NOT HAVE_LIBDL )
##### check for utempter ######################## ##### check for utempter ########################

@ -131,7 +131,7 @@ tde_add_library( ${target} SHARED AUTOMOC
EMBED tdecorenetwork-static tdehw-static EMBED tdecorenetwork-static tdehw-static
LINK ltdlc-static ${KDESVGICONS} DCOP-shared tdefx-shared ${ZLIB_LIBRARIES} LINK ltdlc-static ${KDESVGICONS} DCOP-shared tdefx-shared ${ZLIB_LIBRARIES}
${LIBIDN_LIBRARIES} ${XCOMPOSITE_LIBRARIES} ICE SM ${GAMIN_LIBRARIES} ${LIBIDN_LIBRARIES} ${XCOMPOSITE_LIBRARIES} ICE SM ${GAMIN_LIBRARIES}
${LIBBFD_LIBRARIES} ${LIBBFD_LIBRARIES} util
DEPENDENCIES dcopidl dcopidl2cpp DEPENDENCIES dcopidl dcopidl2cpp
DESTINATION ${LIB_INSTALL_DIR} DESTINATION ${LIB_INSTALL_DIR}
) )

@ -305,6 +305,17 @@ bool KPty::open()
if (d->masterFd >= 0) if (d->masterFd >= 0)
return true; return true;
#if defined(__OpenBSD__)
char cpty[16];
if (openpty(&d->masterFd, &d->slaveFd, cpty, NULL, &d->winSize) == 0) {
d->ttyName = cpty;
} else {
kdWarning(175) << "Can't open slave pseudo teletype" << endl;
return false;
}
#else
TQCString ptyName; TQCString ptyName;
// Find a master pty that we can open //////////////////////////////// // Find a master pty that we can open ////////////////////////////////
@ -379,6 +390,7 @@ bool KPty::open()
kdWarning(175) << "KPty::open(): " << "Can't open a pseudo teletype" << endl; kdWarning(175) << "KPty::open(): " << "Can't open a pseudo teletype" << endl;
return false; return false;
#endif
gotpty: gotpty:
return _attachPty(d->masterFd); return _attachPty(d->masterFd);
@ -568,8 +580,10 @@ int KPty::slaveFd() const
// private // private
bool KPty::chownpty(bool grant) bool KPty::chownpty(bool grant)
{ {
#if !defined(__OpenBSD__)
TDEProcess proc; TDEProcess proc;
proc << locate("exe", BASE_CHOWN) << (grant?"--grant":"--revoke") << TQString::number(d->masterFd); proc << locate("exe", BASE_CHOWN) << (grant?"--grant":"--revoke") << TQString::number(d->masterFd);
return proc.start(TDEProcess::Block) && proc.normalExit() && !proc.exitStatus(); return proc.start(TDEProcess::Block) && proc.normalExit() && !proc.exitStatus();
#endif
} }

@ -66,6 +66,10 @@
TQMutex getXXbyYYmutex; TQMutex getXXbyYYmutex;
#endif #endif
#ifdef __OpenBSD__
#define USE_OPENBSD 1
#endif
using namespace KNetwork; using namespace KNetwork;
using namespace KNetwork::Internal; using namespace KNetwork::Internal;
@ -616,17 +620,28 @@ TQStrList KResolver::protocolName(int protonum)
pe = getprotobynumber(protonum); pe = getprotobynumber(protonum);
#else #else
# ifdef USE_OPENBSD // OpenBSD uses an HP/IBM/DEC API
struct protoent protobuf;
struct protoent_data pdata;
::memset(&pdata, 0, sizeof pdata);
if (getprotobynumber_r(protonum, &protobuf, &pdata) == 0)
pe = &protobuf;
else
pe = 0;
# else
size_t buflen = 1024; size_t buflen = 1024;
struct protoent protobuf; struct protoent protobuf;
char *buf; char *buf;
do do
{ {
buf = new char[buflen]; buf = new char[buflen];
# ifdef USE_SOLARIS // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL # ifdef USE_SOLARIS // Solaris uses a 4 argument getprotobynumber_r which returns struct *protoent or NULL
if ((pe = getprotobynumber_r(protonum, &protobuf, buf, buflen)) && (errno == ERANGE)) if ((pe = getprotobynumber_r(protonum, &protobuf, buf, buflen)) && (errno == ERANGE))
# else # else
if (getprotobynumber_r(protonum, &protobuf, buf, buflen, &pe) == ERANGE) if (getprotobynumber_r(protonum, &protobuf, buf, buflen, &pe) == ERANGE)
# endif # endif
{ {
pe = 0L; pe = 0L;
buflen += 1024; buflen += 1024;
@ -636,6 +651,7 @@ TQStrList KResolver::protocolName(int protonum)
break; break;
} }
while (pe == 0L); while (pe == 0L);
# endif
#endif #endif
// Do common processing // Do common processing
@ -648,7 +664,9 @@ TQStrList KResolver::protocolName(int protonum)
} }
#ifdef HAVE_GETPROTOBYNAME_R #ifdef HAVE_GETPROTOBYNAME_R
# ifndef USE_OPENBSD
delete [] buf; delete [] buf;
# endif
#endif #endif
return lst; return lst;
@ -663,17 +681,28 @@ TQStrList KResolver::protocolName(const char *protoname)
pe = getprotobyname(protoname); pe = getprotobyname(protoname);
#else #else
# ifdef USE_OPENBSD // OpenBSD uses an HP/IBM/DEC API
struct protoent protobuf;
struct protoent_data pdata;
::memset(&pdata, 0, sizeof pdata);
if (getprotobyname_r(protoname, &protobuf, &pdata) == 0)
pe = &protobuf;
else
pe = 0;
# else
size_t buflen = 1024; size_t buflen = 1024;
struct protoent protobuf; struct protoent protobuf;
char *buf; char *buf;
do do
{ {
buf = new char[buflen]; buf = new char[buflen];
# ifdef USE_SOLARIS // Solaris uses a 4 argument getprotobyname_r which returns struct *protoent or NULL # ifdef USE_SOLARIS // Solaris uses a 4 argument getprotobyname_r which returns struct *protoent or NULL
if ((pe = getprotobyname_r(protoname, &protobuf, buf, buflen)) && (errno == ERANGE)) if ((pe = getprotobyname_r(protoname, &protobuf, buf, buflen)) && (errno == ERANGE))
# else # else
if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE) if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE)
# endif # endif
{ {
pe = 0L; pe = 0L;
buflen += 1024; buflen += 1024;
@ -683,6 +712,7 @@ TQStrList KResolver::protocolName(const char *protoname)
break; break;
} }
while (pe == 0L); while (pe == 0L);
# endif
#endif #endif
// Do common processing // Do common processing
@ -695,7 +725,9 @@ TQStrList KResolver::protocolName(const char *protoname)
} }
#ifdef HAVE_GETPROTOBYNAME_R #ifdef HAVE_GETPROTOBYNAME_R
# ifndef USE_OPENBSD
delete [] buf; delete [] buf;
# endif
#endif #endif
return lst; return lst;
@ -710,17 +742,28 @@ int KResolver::protocolNumber(const char *protoname)
pe = getprotobyname(protoname); pe = getprotobyname(protoname);
#else #else
# ifdef USE_OPENBSD // OpenBSD uses an HP/IBM/DEC API
struct protoent protobuf;
struct protoent_data pdata;
::memset(&pdata, 0, sizeof pdata);
if (getprotobyname_r(protoname, &protobuf, &pdata) == 0)
pe = &protobuf;
else
pe = 0;
# else
size_t buflen = 1024; size_t buflen = 1024;
struct protoent protobuf; struct protoent protobuf;
char *buf; char *buf;
do do
{ {
buf = new char[buflen]; buf = new char[buflen];
# ifdef USE_SOLARIS // Solaris uses a 4 argument getprotobyname_r which returns struct *protoent or NULL # ifdef USE_SOLARIS // Solaris uses a 4 argument getprotobyname_r which returns struct *protoent or NULL
if ((pe = getprotobyname_r(protoname, &protobuf, buf, buflen)) && (errno == ERANGE)) if ((pe = getprotobyname_r(protoname, &protobuf, buf, buflen)) && (errno == ERANGE))
# else # else
if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE) if (getprotobyname_r(protoname, &protobuf, buf, buflen, &pe) == ERANGE)
# endif # endif
{ {
pe = 0L; pe = 0L;
buflen += 1024; buflen += 1024;
@ -730,6 +773,7 @@ int KResolver::protocolNumber(const char *protoname)
break; break;
} }
while (pe == 0L); while (pe == 0L);
# endif
#endif #endif
// Do common processing // Do common processing
@ -738,7 +782,9 @@ int KResolver::protocolNumber(const char *protoname)
protonum = pe->p_proto; protonum = pe->p_proto;
#ifdef HAVE_GETPROTOBYNAME_R #ifdef HAVE_GETPROTOBYNAME_R
# ifndef USE_OPENBSD
delete [] buf; delete [] buf;
# endif
#endif #endif
return protonum; return protonum;
@ -753,17 +799,27 @@ int KResolver::servicePort(const char *servname, const char *protoname)
se = getservbyname(servname, protoname); se = getservbyname(servname, protoname);
#else #else
# ifdef USE_OPENBSD // OpenBSD uses an HP/IBM/DEC API
struct servent servbuf;
struct servent_data sdata;
::memset(&sdata, 0, sizeof sdata);
if (getservbyname_r(servname, protoname, &servbuf, &sdata) == 0)
se = &servbuf;
else
se = 0;
# else
size_t buflen = 1024; size_t buflen = 1024;
struct servent servbuf; struct servent servbuf;
char *buf; char *buf;
do do
{ {
buf = new char[buflen]; buf = new char[buflen];
# ifdef USE_SOLARIS // Solaris uses a 5 argument getservbyname_r which returns struct *servent or NULL # ifdef USE_SOLARIS // Solaris uses a 5 argument getservbyname_r which returns struct *servent or NULL
if ((se = getservbyname_r(servname, protoname, &servbuf, buf, buflen)) && (errno == ERANGE)) if ((se = getservbyname_r(servname, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
# else # else
if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE) if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE)
# endif # endif
{ {
se = 0L; se = 0L;
buflen += 1024; buflen += 1024;
@ -773,6 +829,7 @@ int KResolver::servicePort(const char *servname, const char *protoname)
break; break;
} }
while (se == 0L); while (se == 0L);
# endif
#endif #endif
// Do common processing // Do common processing
@ -781,7 +838,9 @@ int KResolver::servicePort(const char *servname, const char *protoname)
servport = ntohs(se->s_port); servport = ntohs(se->s_port);
#ifdef HAVE_GETSERVBYNAME_R #ifdef HAVE_GETSERVBYNAME_R
# ifndef USE_OPENBSD
delete [] buf; delete [] buf;
# endif
#endif #endif
return servport; return servport;
@ -796,17 +855,27 @@ TQStrList KResolver::serviceName(const char* servname, const char *protoname)
se = getservbyname(servname, protoname); se = getservbyname(servname, protoname);
#else #else
# ifdef USE_OPENBSD // OpenBSD uses an HP/IBM/DEC API
struct servent servbuf;
struct servent_data sdata;
::memset(&sdata, 0, sizeof sdata);
if (getservbyname_r(servname, protoname, &servbuf, &sdata) == 0)
se = &servbuf;
else
se = 0;
# else
size_t buflen = 1024; size_t buflen = 1024;
struct servent servbuf; struct servent servbuf;
char *buf; char *buf;
do do
{ {
buf = new char[buflen]; buf = new char[buflen];
# ifdef USE_SOLARIS // Solaris uses a 5 argument getservbyname_r which returns struct *servent or NULL # ifdef USE_SOLARIS // Solaris uses a 5 argument getservbyname_r which returns struct *servent or NULL
if ((se = getservbyname_r(servname, protoname, &servbuf, buf, buflen)) && (errno == ERANGE)) if ((se = getservbyname_r(servname, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
# else # else
if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE) if (getservbyname_r(servname, protoname, &servbuf, buf, buflen, &se) == ERANGE)
# endif # endif
{ {
se = 0L; se = 0L;
buflen += 1024; buflen += 1024;
@ -816,6 +885,7 @@ TQStrList KResolver::serviceName(const char* servname, const char *protoname)
break; break;
} }
while (se == 0L); while (se == 0L);
# endif
#endif #endif
// Do common processing // Do common processing
@ -828,7 +898,9 @@ TQStrList KResolver::serviceName(const char* servname, const char *protoname)
} }
#ifdef HAVE_GETSERVBYNAME_R #ifdef HAVE_GETSERVBYNAME_R
# ifndef USE_OPENBSD
delete [] buf; delete [] buf;
# endif
#endif #endif
return lst; return lst;
@ -843,17 +915,27 @@ TQStrList KResolver::serviceName(int port, const char *protoname)
se = getservbyport(port, protoname); se = getservbyport(port, protoname);
#else #else
# ifdef USE_OPENBSD // OpenBSD uses an HP/IBM/DEC API
struct servent servbuf;
struct servent_data sdata;
::memset(&sdata, 0, sizeof sdata);
if (getservbyport_r(port, protoname, &servbuf, &sdata) == 0)
se = &servbuf;
else
se = 0;
# else
size_t buflen = 1024; size_t buflen = 1024;
struct servent servbuf; struct servent servbuf;
char *buf; char *buf;
do do
{ {
buf = new char[buflen]; buf = new char[buflen];
# ifdef USE_SOLARIS // Solaris uses a 5 argument getservbyport_r which returns struct *servent or NULL # ifdef USE_SOLARIS // Solaris uses a 5 argument getservbyport_r which returns struct *servent or NULL
if ((se = getservbyport_r(port, protoname, &servbuf, buf, buflen)) && (errno == ERANGE)) if ((se = getservbyport_r(port, protoname, &servbuf, buf, buflen)) && (errno == ERANGE))
# else # else
if (getservbyport_r(port, protoname, &servbuf, buf, buflen, &se) == ERANGE) if (getservbyport_r(port, protoname, &servbuf, buf, buflen, &se) == ERANGE)
# endif # endif
{ {
se = 0L; se = 0L;
buflen += 1024; buflen += 1024;
@ -863,6 +945,7 @@ TQStrList KResolver::serviceName(int port, const char *protoname)
break; break;
} }
while (se == 0L); while (se == 0L);
# endif
#endif #endif
// Do common processing // Do common processing
@ -875,7 +958,9 @@ TQStrList KResolver::serviceName(int port, const char *protoname)
} }
#ifdef HAVE_GETSERVBYPORT_R #ifdef HAVE_GETSERVBYPORT_R
# ifndef USE_OPENBSD
delete [] buf; delete [] buf;
# endif
#endif #endif
return lst; return lst;

@ -48,6 +48,7 @@ extern TQMutex getXXbyYYmutex;
#endif #endif
/* some systems have the functions, but don't declare them */ /* some systems have the functions, but don't declare them */
#ifndef __OpenBSD__
#if defined(HAVE_GETSERVBYNAME_R) && !HAVE_DECL_GETSERVBYNAME_R #if defined(HAVE_GETSERVBYNAME_R) && !HAVE_DECL_GETSERVBYNAME_R
extern "C" { extern "C" {
struct servent; struct servent;
@ -69,6 +70,7 @@ extern "C" {
struct protoent** result); struct protoent** result);
} }
#endif #endif
#endif
/* decide whether res_init is thread-safe or not */ /* decide whether res_init is thread-safe or not */
#if defined(__GLIBC__) #if defined(__GLIBC__)

@ -177,7 +177,9 @@ typedef void* IceIOErrorHandler;
#if defined Q_WS_X11 #if defined Q_WS_X11
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef __linux__
#include <linux/vt.h> #include <linux/vt.h>
#endif
extern "C" { extern "C" {
extern int getfd(const char *fnam); extern int getfd(const char *fnam);
} }

@ -43,7 +43,11 @@
#include <kdebug.h> #include <kdebug.h>
#include <tqsocketnotifier.h> #include <tqsocketnotifier.h>
#if defined(__OpenBSD__)
#define __progname getprogname()
#else
extern char *__progname; extern char *__progname;
#endif
using namespace TDEIO; using namespace TDEIO;

@ -778,10 +778,15 @@ bool KURLCompletion::userCompletion(const MyURL &url, TQString *match)
// Environment variables // Environment variables
// //
#if !defined(__OpenBSD__)
extern char **environ; // Array of environment variables extern char **environ; // Array of environment variables
#endif
bool KURLCompletion::envCompletion(const MyURL &url, TQString *match) bool KURLCompletion::envCompletion(const MyURL &url, TQString *match)
{ {
#if defined(__OpenBSD__)
return false;
#else
if ( url.file().at(0) != '$' ) if ( url.file().at(0) != '$' )
return false; return false;
@ -816,6 +821,7 @@ bool KURLCompletion::envCompletion(const MyURL &url, TQString *match)
*match = finished(); *match = finished();
return true; return true;
#endif
} }
////////////////////////////////////////////////// //////////////////////////////////////////////////

@ -1455,6 +1455,9 @@ void FileProtocol::mount( bool _ro, const char *_fstype, const TQString& _dev, c
dev.data() dev.data()
point.data() point.data()
tmp ); tmp );
#elif defined(__OpenBSD__)
buffer.sprintf( "%s %s %s -t %s %s %s 2>%s", "tdesu", mountProg.latin1(), readonly.data(),
fstype.data(), dev.data(), point.data(), tmp );
#else #else
buffer.sprintf( "%s %s -t %s %s %s 2>%s", mountProg.latin1(), readonly.data(), buffer.sprintf( "%s %s -t %s %s %s 2>%s", mountProg.latin1(), readonly.data(),
fstype.data(), dev.data(), point.data(), tmp ); fstype.data(), dev.data(), point.data(), tmp );
@ -1614,7 +1617,11 @@ void FileProtocol::unmount( const TQString& _point )
error( TDEIO::ERR_COULD_NOT_UNMOUNT, i18n("Could not find program \"umount\"")); error( TDEIO::ERR_COULD_NOT_UNMOUNT, i18n("Could not find program \"umount\""));
return; return;
} }
#ifdef __OpenBSD__
buffer.sprintf( "%s %s %s 2>%s", "tdesu", umountProg.latin1(), TQFile::encodeName(TDEProcess::quote(_point)).data(), tmp );
#else
buffer.sprintf( "%s %s 2>%s", umountProg.latin1(), TQFile::encodeName(TDEProcess::quote(_point)).data(), tmp ); buffer.sprintf( "%s %s 2>%s", umountProg.latin1(), TQFile::encodeName(TDEProcess::quote(_point)).data(), tmp );
#endif
system( buffer.data() ); system( buffer.data() );
#endif /* HAVE_VOLMGT */ #endif /* HAVE_VOLMGT */

@ -44,6 +44,7 @@
#include <tdeio/passdlg.h> #include <tdeio/passdlg.h>
#include <kguiitem.h> #include <kguiitem.h>
#include <kprocess.h> #include <kprocess.h>
#include <tqprocess.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
@ -70,6 +71,18 @@ extern "C"
int getServerPid() int getServerPid()
{ {
#if defined(__OpenBSD__)
TQProcess *proc = new TQProcess();
proc->addArgument("pgrep");
proc->addArgument("cupsd");
proc->start();
while (proc->isRunning()); //Wait for process to exit
TQString pidString = proc->readLineStdout();
bool ok;
int pid = pidString.toInt(&ok);
if (ok) return pid;
return (-1);
#else
TQDir dir("/proc",TQString::null,TQDir::Name,TQDir::Dirs); TQDir dir("/proc",TQString::null,TQDir::Name,TQDir::Dirs);
for (uint i=0;i<dir.count();i++) for (uint i=0;i<dir.count();i++)
{ {
@ -88,6 +101,7 @@ int getServerPid()
} }
} }
return (-1); return (-1);
#endif
} }
const char* getPassword(const char*) const char* getPassword(const char*)

@ -101,11 +101,20 @@ TQString KMCupsManager::driverDbCreationProgram()
TQString KMCupsManager::driverDirectory() TQString KMCupsManager::driverDirectory()
{ {
TQString d = cupsInstallDir(); TQString d = cupsInstallDir();
if (d.isEmpty()) if (d.isEmpty()) {
#ifdef __OpenBSD__
d = "/usr/local";
#else
d = "/usr"; d = "/usr";
#endif
}
d.append("/share/cups/model"); d.append("/share/cups/model");
// raw foomatic support // raw foomatic support
#ifdef __OpenBSD__
d.append(":/usr/local/share/foomatic/db/source");
#else
d.append(":/usr/share/foomatic/db/source"); d.append(":/usr/share/foomatic/db/source");
#endif
return d; return d;
} }
@ -138,7 +147,7 @@ bool KMCupsManager::createPrinter(KMPrinter *p)
req.setOperation(CUPS_ADD_CLASS); req.setOperation(CUPS_ADD_CLASS);
TQStringList members = p->members(), uris; TQStringList members = p->members(), uris;
TQString s; TQString s;
s = TQString::fromLocal8Bit("ipp://%1/printers/").arg(CupsInfos::self()->hostaddr()); s = TQString::fromLocal8Bit("ipp://%1/printers/").arg(CupsInfos::self()->hostaddr());
for (TQStringList::ConstIterator it=members.begin(); it!=members.end(); ++it) for (TQStringList::ConstIterator it=members.begin(); it!=members.end(); ++it)
uris.append(s+(*it)); uris.append(s+(*it));
req.addURI(IPP_TAG_PRINTER,"member-uris",uris); req.addURI(IPP_TAG_PRINTER,"member-uris",uris);
@ -627,7 +636,11 @@ DrMain* KMCupsManager::loadMaticDriver(const TQString& drname)
{ {
TQStringList comps = TQStringList::split('/', drname, false); TQStringList comps = TQStringList::split('/', drname, false);
TQString tmpFile = locateLocal("tmp", "foomatic_" + kapp->randomString(8)); TQString tmpFile = locateLocal("tmp", "foomatic_" + kapp->randomString(8));
#ifdef __OpenBSD__
TQString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/local/bin:/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
#else
TQString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); TQString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
#endif
TQString exe = TDEStandardDirs::findExe("foomatic-datafile", PATH); TQString exe = TDEStandardDirs::findExe("foomatic-datafile", PATH);
if (exe.isEmpty()) if (exe.isEmpty())
{ {
@ -937,10 +950,15 @@ void KMCupsManager::exportDriver()
!m_currentprinter->isClass(true) && !m_currentprinter->isSpecial()) !m_currentprinter->isClass(true) && !m_currentprinter->isSpecial())
{ {
TQString path = cupsInstallDir(); TQString path = cupsInstallDir();
if (path.isEmpty()) if (path.isEmpty()) {
#ifdef __OpenBSD__
path = "/usr/local/share/cups";
#else
path = "/usr/share/cups"; path = "/usr/share/cups";
else #endif
} else {
path += "/share/cups"; path += "/share/cups";
}
CupsAddSmb::exportDest(m_currentprinter->printerName(), path); CupsAddSmb::exportDest(m_currentprinter->printerName(), path);
} }
} }

@ -36,6 +36,6 @@ set( ${target}_SRCS
tde_add_kpart( ${target} AUTOMOC tde_add_kpart( ${target} AUTOMOC
SOURCES ${${target}_SRCS} SOURCES ${${target}_SRCS}
LINK tdefx-shared tdecore-shared dl LINK tdefx-shared tdecore-shared ${DL_LIBRARIES}
DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/styles DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/styles
) )

@ -188,7 +188,11 @@ KSpellConfig::readGlobalSettings()
setDictionary ( kc->readEntry("KSpell_Dictionary") ); setDictionary ( kc->readEntry("KSpell_Dictionary") );
setDictFromList ( kc->readNumEntry("KSpell_DictFromList", false) ); setDictFromList ( kc->readNumEntry("KSpell_DictFromList", false) );
setEncoding ( kc->readNumEntry ("KSpell_Encoding", KS_E_UTF8) ); setEncoding ( kc->readNumEntry ("KSpell_Encoding", KS_E_UTF8) );
#ifdef __OpenBSD__
setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ASPELL) );
#else
setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ISPELL) ); setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ISPELL) );
#endif
return true; return true;
} }

Loading…
Cancel
Save