Fix several issues on freebsd

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 10 years ago
parent e75569be1b
commit e469e42c76

@ -68,10 +68,13 @@
#include <unistd.h> #include <unistd.h>
#include <grp.h> #include <grp.h>
#if defined(HAVE_LIBUTIL_H) && (!defined(__FreeBSD__) || __FreeBSD_version < 900007) #if defined(HAVE_LIBUTIL_H)
# include <libutil.h> # include <libutil.h>
# define USE_LOGIN # if (!defined(__FreeBSD__) || __FreeBSD_version < 900007)
#elif defined(HAVE_UTIL_H) # define USE_LOGIN
# endif
#endif
#if defined(HAVE_UTIL_H)
# include <util.h> # include <util.h>
# define USE_LOGIN # define USE_LOGIN
#endif #endif
@ -305,7 +308,7 @@ bool KPty::open()
if (d->masterFd >= 0) if (d->masterFd >= 0)
return true; return true;
#if defined(__OpenBSD__) #if defined(__OpenBSD__) || defined(__FreeBSD__)
char cpty[16]; char cpty[16];
if (openpty(&d->masterFd, &d->slaveFd, cpty, NULL, &d->winSize) == 0) { if (openpty(&d->masterFd, &d->slaveFd, cpty, NULL, &d->winSize) == 0) {
@ -580,7 +583,7 @@ int KPty::slaveFd() const
// private // private
bool KPty::chownpty(bool grant) bool KPty::chownpty(bool grant)
{ {
#if !defined(__OpenBSD__) #if !defined(__OpenBSD__) && !defined(__FreeBSD__)
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();

@ -71,7 +71,7 @@ extern "C"
int getServerPid() int getServerPid()
{ {
#if defined(__OpenBSD__) #if defined(__OpenBSD__) || defined(__FreeBSD__)
TQProcess *proc = new TQProcess(); TQProcess *proc = new TQProcess();
proc->addArgument("pgrep"); proc->addArgument("pgrep");
proc->addArgument("cupsd"); proc->addArgument("cupsd");

@ -102,7 +102,7 @@ TQString KMCupsManager::driverDirectory()
{ {
TQString d = cupsInstallDir(); TQString d = cupsInstallDir();
if (d.isEmpty()) { if (d.isEmpty()) {
#ifdef __OpenBSD__ #if defined(__OpenBSD__) || defined(__FreeBSD__)
d = "/usr/local"; d = "/usr/local";
#else #else
d = "/usr"; d = "/usr";
@ -110,7 +110,7 @@ TQString KMCupsManager::driverDirectory()
} }
d.append("/share/cups/model"); d.append("/share/cups/model");
// raw foomatic support // raw foomatic support
#ifdef __OpenBSD__ #if defined(__OpenBSD__) || defined(__FreeBSD__)
d.append(":/usr/local/share/foomatic/db/source"); d.append(":/usr/local/share/foomatic/db/source");
#else #else
d.append(":/usr/share/foomatic/db/source"); d.append(":/usr/share/foomatic/db/source");
@ -640,7 +640,7 @@ 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__ #if defined(__OpenBSD__) || defined(__FreeBSD__)
TQString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/local/bin:/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); TQString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/local/bin:/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
#else #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");
@ -959,7 +959,7 @@ void KMCupsManager::exportDriver()
{ {
TQString path = cupsInstallDir(); TQString path = cupsInstallDir();
if (path.isEmpty()) { if (path.isEmpty()) {
#ifdef __OpenBSD__ #if defined(__OpenBSD__) || defined(__FreeBSD__)
path = "/usr/local/share/cups"; path = "/usr/local/share/cups";
#else #else
path = "/usr/share/cups"; path = "/usr/share/cups";

@ -188,7 +188,7 @@ 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__ #if defined(__OpenBSD__) || defined(__FreeBSD__)
setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ASPELL) ); setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ASPELL) );
#else #else
setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ISPELL) ); setClient ( kc->readNumEntry ("KSpell_Client", KS_CLIENT_ISPELL) );

Loading…
Cancel
Save