diff --git a/cursors/src/cursors.cmake b/cursors/src/cursors.cmake index 19f6bb58..c72ca721 100644 --- a/cursors/src/cursors.cmake +++ b/cursors/src/cursors.cmake @@ -49,22 +49,12 @@ macro(add_x_cursor theme cursor dpi) -P ${MAKE_CONFIG} ) # Use the adopted x cursor config file and the png files to produce the cursor file - if(NOT WIN32) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor} DEPENDS ${inputs} ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in COMMAND ${XCURSORGEN} -p ${CMAKE_BINARY_DIR}/oxy-${theme}/png ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor} ) - else(NOT WIN32) - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor} - DEPENDS ${inputs} ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in - COMMAND "${CMAKE_SOURCE_DIR}/wincursor.py" ${CMAKE_BINARY_DIR}/oxy-${theme}/png - ${CMAKE_BINARY_DIR}/oxy-${theme}/config/${cursor}.in - ${CMAKE_BINARY_DIR}/wincursors/oxy-${theme} - ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors/${cursor} - ) - endif(NOT WIN32) endmacro(add_x_cursor) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/packages) @@ -82,9 +72,6 @@ macro(add_theme color theme dpi) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/svg) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/config) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/oxy-${theme}/cursors) - if(WIN32) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/wincursors/oxy-${theme}) - endif(WIN32) set(${theme}_cursors) # render SVG to PNG files foreach(svg ${SVGS}) diff --git a/cursors/src/wincursor.py b/cursors/src/wincursor.py deleted file mode 100644 index ddb5e528..00000000 --- a/cursors/src/wincursor.py +++ /dev/null @@ -1,50 +0,0 @@ -import sys -import os - -configs = ["left_ptr.in", "help.in", "progress.in", "wait.in", "cross.in", "text.in", "pencil.in", "circle.in", "size_ver.in", "size_hor.in", "size_fdiag.in", "size_bdiag.in", "fleur.in", "up_arrow.in", "pointer.in"] - -if len(sys.argv) < 4: - print "too few arguments for wincursor" - sys.exit(1) - -pngdir = sys.argv[1] -conf = sys.argv[2] -outdir = sys.argv[3] -dummy = sys.argv[4] - -f = open(dummy, "w") -f.close() - -if not configs.count(conf[conf.rfind("/")+1:]): - sys.exit(0) -else: - conffile = conf[conf.rfind("/")+1:] - -f = open(conf) -r = f.read() -f.close() - -ls = r.split("\n") -imglist = [] - -for l in ls: - if l and not l.startswith("#"): - v = l.split(" ") - if len(v) == 4: - imglist += [(v[3], v[1], v[2])] - elif len(v) == 5: - imglist += [(v[3], v[1], v[2], v[4])] - -if len(imglist) > 1: - pngls = [os.path.join(pngdir, i[0]) for i in imglist] - pngstr = "" - for p in pngls: - pngstr += " %s" % p - - img = imglist[0] - jiffie = int((float(img[3]) / 1000) * 60) - - print os.popen4("png2ico %s --hotspotx %s --hotspoty %s --framerate %s %s" % (os.path.join(outdir, conffile.replace(".in", ".ani")), img[1], img[2], jiffie, pngstr))[1].read() -elif len(imglist) == 1: - img = imglist[0] - print os.popen4("png2ico %s --hotspotx %s --hotspoty %s %s" % (os.path.join(outdir, conffile.replace(".in", ".cur")), img[1], img[2], os.path.join(pngdir, img[0])))[1].read() diff --git a/drkonqi/drkonqibackends.cpp b/drkonqi/drkonqibackends.cpp index 6ae47ff4..421b81d7 100644 --- a/drkonqi/drkonqibackends.cpp +++ b/drkonqi/drkonqibackends.cpp @@ -77,7 +77,6 @@ bool KCrashBackend::init() return false; } -#if !defined(Q_OS_WIN32) if (::kill(crashedApplication()->pid(), 0) < 0) { switch (errno) { case EPERM: @@ -108,7 +107,6 @@ bool KCrashBackend::init() //process when we try to continue it. QTimer::singleShot(2000, this, SLOT(stopAttachedProcess())); } -#endif //Handle drkonqi crashes s_pid = crashedApplication()->pid(); //copy pid for use by the crash handler, so that it is safer diff --git a/drkonqi/systeminformation.cpp b/drkonqi/systeminformation.cpp index ee6e489a..d69d1198 100644 --- a/drkonqi/systeminformation.cpp +++ b/drkonqi/systeminformation.cpp @@ -66,20 +66,8 @@ QString SystemInformation::fetchOSBasicInformation() const return QLatin1String("NetBSD"); #elif defined(Q_OS_OPENBSD) return QLatin1String("OpenBSD"); -#elif defined(Q_OS_AIX) - return QLatin1String("AIX"); -#elif defined(Q_OS_HPUX) - return QLatin1String("HP-UX"); -#elif defined(Q_OS_IRIX) - return QLatin1String("IRIX"); -#elif defined(Q_OS_OSF) - return QLatin1String("Tru64"); #elif defined(Q_OS_SOLARIS) return QLatin1String("Solaris"); -#elif defined(Q_OS_CYGWIN) - return QLatin1String("Cygwin"); -#elif defined(Q_OS_WIN32) - return QLatin1String("MS Windows"); #else return OS_UNSPECIFIED; #endif diff --git a/kcheckpass/CMakeLists.txt b/kcheckpass/CMakeLists.txt index e67fbc66..e51b6da4 100644 --- a/kcheckpass/CMakeLists.txt +++ b/kcheckpass/CMakeLists.txt @@ -13,8 +13,6 @@ set(kcheckpass_SRCS checkpass_etcpasswd.c checkpass_pam.c checkpass_shadow.c - checkpass_osfc2passwd.c - checkpass_aix.c ) add_executable(kcheckpass ${kcheckpass_SRCS}) diff --git a/kcheckpass/checkpass_aix.c b/kcheckpass/checkpass_aix.c deleted file mode 100644 index 8f06cfe6..00000000 --- a/kcheckpass/checkpass_aix.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2001 Reza Arbab - * Copyright (c) 2003 Oswald Buddenhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "kcheckpass.h" - -#ifdef HAVE_AIX_AUTH -#include -#include -#include -#include - -/* - * The AIX builtin authenticate() uses whichever method the system - * has been configured for. (/etc/passwd, DCE, etc.) - */ -int authenticate(const char *, const char *, int *, char **); - -AuthReturn Authenticate(const char *method, - const char *login, char *(*conv) (ConvRequest, const char *)) -{ - int result; - int reenter; /* Tells if authenticate is done processing or not. */ - char *passwd; - char *msg; /* Contains a prompt message or failure reason. */ - - if (!strcmp(method, "classic")) { - - if (!(passwd = conv(ConvGetHidden, 0))) - return AuthAbort; - - if ((result = authenticate(login, passwd, &reenter, &msg))) { - if (msg) { - conv(ConvPutError, msg); - free(msg); - } - dispose(passwd); - return AuthBad; - } - if (reenter) { - char buf[256]; - snprintf(buf, sizeof(buf), "More authentication data requested: %s\n", msg); - conv(ConvPutError, buf); - free(msg); - dispose(passwd); - return result == ENOENT || result == ESAD ? AuthBad : AuthError; - } - dispose(passwd); - return AuthOk; - - } else if (!strcmp(method, "generic")) { - - for (passwd = 0;;) { - if ((result = authenticate(login, passwd, &reenter, &msg))) { - if (msg) { - conv(ConvPutError, msg); - free(msg); - } - if (passwd) - dispose(passwd); - return result == ENOENT || result == ESAD ? AuthBad : AuthError; - } - if (passwd) - dispose(passwd); - if (!reenter) - break; - passwd = conv(ConvGetHidden, msg); - free(msg); - if (!passwd) - return AuthAbort; - } - return AuthOk; - - } else - return AuthError; - -} - -#endif diff --git a/kcheckpass/checkpass_osfc2passwd.c b/kcheckpass/checkpass_osfc2passwd.c deleted file mode 100644 index d1812336..00000000 --- a/kcheckpass/checkpass_osfc2passwd.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * - * Copyright (C) 1999 Mark Davies - * Copyright (C) 2003 Oswald Buddenhagen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "kcheckpass.h" - -#ifdef HAVE_OSF_C2_PASSWD - -static char *osf1c2crypt(const char *pw, char *salt); -static int osf1c2_getprpwent(char *p, char *n, int len); - -/******************************************************************* - * This is the authentication code for OSF C2 security passwords - *******************************************************************/ - -#include -#include -#include - -AuthReturn Authenticate(const char *method, - const char *login, char *(*conv) (ConvRequest, const char *)) -{ - char *passwd; - char *crpt_passwd; - char c2passwd[256]; - - if (strcmp(method, "classic")) - return AuthError; - - if (!osf1c2_getprpwent(c2passwd, login, sizeof(c2passwd))) - return AuthBad; - - if (!*c2passwd) - return AuthOk; - - if (!(passwd = conv(ConvGetHidden, 0))) - return AuthAbort; - - if ((crpt_passwd = osf1c2crypt(passwd, c2passwd)) && !strcmp(c2passwd, crpt_passwd)) { - dispose(passwd); - return AuthOk; /* Success */ - } - dispose(passwd); - return AuthBad; /* Password wrong or account locked */ -} - - -/* -The following code was lifted from the file osfc2.c from the ssh 1.2.26 -distribution. Parts of the code that were not needed by kcheckpass -(notably the osf1c2_check_account_and_terminal() function and the code -to set the external variable days_before_password_expires have been -removed). The original copyright from the osfc2.c file is included -below. -*/ - -/* - -osfc2.c - -Author: Christophe Wolfhugel - -Copyright (c) 1995 Christophe Wolfhugel - -Free use of this file is permitted for any purpose as long as -this copyright is preserved in the header. - -This program implements the use of the OSF/1 C2 security extensions -within ssh. See the file COPYING for full licensing information. - -*/ - -#include -#include -#include - -static int c2security = -1; -static int crypt_algo; - -static void -initialize_osf_security(int ac, char **av) -{ - FILE *f; - char buf[256]; - char siad[] = "siad_ses_init="; - - if (access(SIAIGOODFILE, F_OK) == -1) - { - /* Broken OSF/1 system, better don't run on it. */ - fprintf(stderr, SIAIGOODFILE); - fprintf(stderr, " does not exist. Your OSF/1 system is probably broken\n"); - exit(1); - } - if ((f = fopen(MATRIX_CONF, "r")) == NULL) - { - /* Another way OSF/1 is probably broken. */ - fprintf(stderr, "%s unreadable. Your OSF/1 system is probably broken.\n" - - MATRIX_CONF); - exit(1); - } - - /* Read matrix.conf to check if we run C2 or not */ - while (fgets(buf, sizeof(buf), f) != NULL) - { - if (strncmp(buf, siad, sizeof(siad) - 1) == 0) - { - if (strstr(buf, "OSFC2") != NULL) - c2security = 1; - else if (strstr(buf, "BSD") != NULL) - c2security = 0; - break; - } - } - fclose(f); - if (c2security == -1) - { - fprintf(stderr, "C2 security initialization failed : could not determine security level.\n"); - exit(1); - } - if (c2security == 1) - set_auth_parameters(ac, av); -} - - -static int -osf1c2_getprpwent(char *p, char *n, int len) -{ - time_t pschg, tnow; - - if (c2security == 1) - { - struct es_passwd *es; - struct pr_passwd *pr = getprpwnam(n); - if (pr) - { - strlcpy(p, pr->ufld.fd_encrypt, len); - crypt_algo = pr->ufld.fd_oldcrypt; - - tnow = time(NULL); - if (pr->uflg.fg_schange == 1) - pschg = pr->ufld.fd_schange; - else - pschg = 0; - if (pr->uflg.fg_template == 0) - { - /** default template, system values **/ - if (pr->sflg.fg_lifetime == 1) - if (pr->sfld.fd_lifetime > 0 && - pschg + pr->sfld.fd_lifetime < tnow) - return 1; - } - else /** user template, specific values **/ - { - es = getespwnam(pr->ufld.fd_template); - if (es) - { - if (es->uflg->fg_expire == 1) - if (es->ufld->fd_expire > 0 && - pschg + es->ufld->fd_expire < tnow) - return 1; - } - } - } - } - else - { - struct passwd *pw = getpwnam(n); - if (pw) - { - strlcpy(p, pw->pw_passwd, len); - return 1; - } - } - return 0; -} - -static char * -osf1c2crypt(const char *pw, char *salt) -{ - if (c2security == 1) { - return(dispcrypt(pw, salt, crypt_algo)); - } else - return(crypt(pw, salt)); -} - -#endif diff --git a/kcheckpass/checkpass_shadow.c b/kcheckpass/checkpass_shadow.c index c0f6913f..c62b04e2 100644 --- a/kcheckpass/checkpass_shadow.c +++ b/kcheckpass/checkpass_shadow.c @@ -34,10 +34,7 @@ #include #include #include - -#ifndef __hpux #include -#endif AuthReturn Authenticate(const char *method, const char *login, char *(*conv) (ConvRequest, const char *)) diff --git a/kcheckpass/kcheckpass.c b/kcheckpass/kcheckpass.c index fd2d2215..0c431cf7 100644 --- a/kcheckpass/kcheckpass.c +++ b/kcheckpass/kcheckpass.c @@ -73,51 +73,51 @@ conv_legacy (ConvRequest what, const char *prompt) switch (what) { case ConvGetBinary: - break; + break; case ConvGetNormal: - /* there is no prompt == 0 case */ - if (!havetty) - break; - /* i guess we should use /dev/tty ... */ - fputs(prompt, stdout); - fflush(stdout); - if (!fgets(buf, sizeof(buf), stdin)) - return 0; - len = strlen(buf); - if (len && buf[len - 1] == '\n') - buf[--len] = 0; - return strdup(buf); + /* there is no prompt == 0 case */ + if (!havetty) + break; + /* i guess we should use /dev/tty ... */ + fputs(prompt, stdout); + fflush(stdout); + if (!fgets(buf, sizeof(buf), stdin)) + return 0; + len = strlen(buf); + if (len && buf[len - 1] == '\n') + buf[--len] = 0; + return strdup(buf); case ConvGetHidden: - if (havetty) { + if (havetty) { #ifdef HAVE_GETPASSPHRASE - p = getpassphrase(prompt ? prompt : "Password: "); + p = getpassphrase(prompt ? prompt : "Password: "); #else - p = getpass(prompt ? prompt : "Password: "); + p = getpass(prompt ? prompt : "Password: "); #endif - p2 = strdup(p); - memset(p, 0, strlen(p)); - return p2; - } else { - if (prompt) - break; - if ((len = read(0, buf, sizeof(buf) - 1)) < 0) { - message("Cannot read password\n"); - return 0; - } else { - if (len && buf[len - 1] == '\n') - --len; - buf[len] = 0; - p2 = strdup(buf); - memset(buf, 0, len); - return p2; - } - } + p2 = strdup(p); + memset(p, 0, strlen(p)); + return p2; + } else { + if (prompt) + break; + if ((len = read(0, buf, sizeof(buf) - 1)) < 0) { + message("Cannot read password\n"); + return 0; + } else { + if (len && buf[len - 1] == '\n') + --len; + buf[len] = 0; + p2 = strdup(buf); + memset(buf, 0, len); + return p2; + } + } case ConvPutInfo: - message("Information: %s\n", prompt); - return 0; + message("Information: %s\n", prompt); + return 0; case ConvPutError: - message("Error: %s\n", prompt); - return 0; + message("Error: %s\n", prompt); + return 0; } message("Authentication backend requested data type which cannot be handled.\n"); return 0; @@ -130,18 +130,18 @@ Reader (void *buf, int count) int ret, rlen; for (rlen = 0; rlen < count; ) { - dord: - ret = read (sfd, (void *)((char *)buf + rlen), count - rlen); - if (ret < 0) { - if (errno == EINTR) - goto dord; - if (errno == EAGAIN) - break; - return -1; - } - if (!ret) - break; - rlen += ret; + dord: + ret = read (sfd, (void *)((char *)buf + rlen), count - rlen); + if (ret < 0) { + if (errno == EINTR) + goto dord; + if (errno == EAGAIN) + break; + return -1; + } + if (!ret) + break; + rlen += ret; } return rlen; } @@ -150,8 +150,8 @@ static void GRead (void *buf, int count) { if (Reader (buf, count) != count) { - message ("Communication breakdown on read\n"); - exit(15); + message ("Communication breakdown on read\n"); + exit(15); } } @@ -159,8 +159,8 @@ static void GWrite (const void *buf, int count) { if (write (sfd, buf, count) != count) { - message ("Communication breakdown on write\n"); - exit(15); + message ("Communication breakdown on write\n"); + exit(15); } } @@ -201,10 +201,10 @@ GRecvStr (void) char *buf; if (!(len = GRecvInt())) - return (char *)0; + return (char *)0; if (len > 0x1000 || !(buf = malloc (len))) { - message ("No memory for read buffer\n"); - exit(15); + message ("No memory for read buffer\n"); + exit(15); } GRead (buf, len); buf[len - 1] = 0; /* we're setuid ... don't trust "them" */ @@ -219,20 +219,20 @@ GRecvArr (void) unsigned const char *up; if (!(len = (unsigned) GRecvInt())) - return (char *)0; + return (char *)0; if (len < 4) { - message ("Too short binary authentication data block\n"); - exit(15); + message ("Too short binary authentication data block\n"); + exit(15); } if (len > 0x10000 || !(arr = malloc (len))) { - message ("No memory for read buffer\n"); - exit(15); + message ("No memory for read buffer\n"); + exit(15); } GRead (arr, len); up = (unsigned const char *)arr; if (len != (unsigned)(up[3] | (up[2] << 8) | (up[1] << 16) | (up[0] << 24))) { - message ("Mismatched binary authentication data block size\n"); - exit(15); + message ("Mismatched binary authentication data block size\n"); + exit(15); } return arr; } @@ -245,33 +245,35 @@ conv_server (ConvRequest what, const char *prompt) switch (what) { case ConvGetBinary: { - unsigned const char *up = (unsigned const char *)prompt; - int len = up[3] | (up[2] << 8) | (up[1] << 16) | (up[0] << 24); - GSendArr (len, prompt); - return GRecvArr (); + unsigned const char *up = (unsigned const char *)prompt; + int len = up[3] | (up[2] << 8) | (up[1] << 16) | (up[0] << 24); + GSendArr (len, prompt); + return GRecvArr (); } case ConvGetNormal: case ConvGetHidden: { - char *msg; - GSendStr (prompt); - msg = GRecvStr (); - if (msg && (GRecvInt() & IsPassword) && !*msg) - nullpass = 1; - return msg; + char *msg; + GSendStr (prompt); + msg = GRecvStr (); + if (msg && (GRecvInt() & IsPassword) && !*msg) + nullpass = 1; + return msg; } case ConvPutInfo: case ConvPutError: default: - GSendStr (prompt); - return 0; + { + GSendStr (prompt); + return 0; + } } } void message(const char *fmt, ...) { - va_list ap; + va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); @@ -321,10 +323,6 @@ main(int argc, char **argv) struct flock lk; char fname[64], fcont[64]; -#ifdef HAVE_OSF_C2_PASSWD - initialize_osf_security(argc, argv); -#endif - /* Make sure stdout/stderr are open */ for (c = 1; c <= 2; c++) { if (fcntl(c, F_GETFL) == -1) { diff --git a/kcheckpass/kcheckpass.h b/kcheckpass/kcheckpass.h index d75341c8..779d6b97 100644 --- a/kcheckpass/kcheckpass.h +++ b/kcheckpass/kcheckpass.h @@ -56,24 +56,10 @@ #define _PATH_TMP "/tmp/" #endif - -#ifdef ultrix -#include -#endif - #include -#ifdef OSF1_ENH_SEC -#include -#include -#endif - /* Make sure there is only one! */ #if defined(HAVE_PAM) -# undef HAVE_OSF_C2_PASSWD -#elif defined(HAVE_OSF_C2_PASSWD) -#elif defined(_AIX) -# define HAVE_AIX_AUTH #elif defined(HAVE_GETSPNAM) # define HAVE_SHADOW #else diff --git a/kcontrol/style/kcmstyle.cpp b/kcontrol/style/kcmstyle.cpp index e194b342..4c3e752c 100644 --- a/kcontrol/style/kcmstyle.cpp +++ b/kcontrol/style/kcmstyle.cpp @@ -102,7 +102,6 @@ extern "C" // Write some Qt root property. #ifdef Q_WS_X11 -#ifndef __osf__ // this crashes under Tru64 randomly -- will fix later QByteArray properties; QDataStream d(&properties, QIODevice::WriteOnly); d.setVersion(QDataStream::Qt_4_8); @@ -115,7 +114,6 @@ extern "C" XChangeProperty(QX11Info::display(), RootWindow(QX11Info::display(), i), a, a, 8, PropModeReplace, (unsigned char*) properties.data(), properties.size()); -#endif #endif } } diff --git a/kdm/backend/auth.c b/kdm/backend/auth.c index 3429fef3..7355e82a 100644 --- a/kdm/backend/auth.c +++ b/kdm/backend/auth.c @@ -54,7 +54,7 @@ from the copyright holder. As since the demise of imake nobody is setting many of these variables any more, NEED_UTSNAME is essentially always defined. Who cares? */ -#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) +#ifdef _POSIX_SOURCE # define NEED_UTSNAME # include #endif @@ -64,15 +64,6 @@ from the copyright holder. # undef SIOCGIFCONF #else /* __GNU__ */ # include -# ifdef __svr4__ -# include -# include -# include -# endif -# ifdef __EMX__ -# define chown(a,b,c) -# include -# endif #endif /* __GNU__ */ #include @@ -631,34 +622,6 @@ defineLocal(FILE *file, Xauth *auth, int *ok) file, auth, ok); } -#ifdef SYSV_SIOCGIFCONF - -/* Deal with different SIOCGIFCONF ioctl semantics on SYSV, SVR4 */ - -int -ifioctl(int fd, int cmd, char *arg) -{ - struct strioctl ioc; - int ret; - - bzero(&ioc, sizeof(ioc)); - ioc.ic_cmd = cmd; - ioc.ic_timout = 0; - if (cmd == SIOCGIFCONF) { - ioc.ic_len = ((struct ifconf *)arg)->ifc_len; - ioc.ic_dp = ((struct ifconf *)arg)->ifc_buf; - } else { - ioc.ic_len = sizeof(struct ifreq); - ioc.ic_dp = arg; - } - ret = ioctl(fd, I_STR, (char *)&ioc); - if (ret >= 0 && cmd == SIOCGIFCONF) - ((struct ifconf *)arg)->ifc_len = ioc.ic_len; - return (ret); -} - -#endif /* SYSV_SIOCGIFCONF */ - #ifdef HAVE_GETIFADDRS # include @@ -711,7 +674,7 @@ defineSelf(FILE *file, Xauth *auth, int *ok) } #else /* GETIFADDRS */ -#if defined(STREAMSCONN) && !defined(SYSV_SIOCGIFCONF) && !defined(WINTCP) +#if defined(STREAMSCONN) && !defined(SYSV_SIOCGIFCONF) #include @@ -735,86 +698,8 @@ defineSelf(int fd, FILE *file, Xauth *auth, int *ok) #else -#ifdef WINTCP /* NCR with Wollongong TCP */ - -#include -#include - -#include -#include -#include -#include -#include -#include - -static void -defineSelf(int fd, FILE *file, Xauth *auth, int *ok) -{ - /* - * The Wollongong drivers used by NCR SVR4/MP-RAS don't understand the - * socket IO calls that most other drivers seem to like. Because of - * this, this routine must be special cased for NCR. Eventually, - * this will be cleared up. - */ - - struct ipb ifnet; - struct in_ifaddr ifaddr; - struct strioctl str; - int len, ipfd; - - if ((ipfd = open("/dev/ip", O_RDWR, 0)) < 0) { - logError("Trouble getting interface configuration\n"); - return; - } - - /* Indicate that we want to start at the beginning */ - ifnet.ib_next = (struct ipb *)1; - - while (ifnet.ib_next) { - str.ic_cmd = IPIOC_GETIPB; - str.ic_timout = 0; - str.ic_len = sizeof(struct ipb); - str.ic_dp = (char *)&ifnet; - - if (ioctl(ipfd, (int)I_STR, (char *)&str) < 0) { - close(ipfd); - logError("Trouble getting interface configuration\n"); - return; - } - - ifaddr.ia_next = (struct in_ifaddr *)ifnet.if_addrlist; - str.ic_cmd = IPIOC_GETINADDR; - str.ic_timout = 0; - str.ic_len = sizeof(struct in_ifaddr); - str.ic_dp = (char *)&ifaddr; - - if (ioctl(ipfd, (int)I_STR, (char *)&str) < 0) { - close(ipfd); - logError("Trouble getting interface configuration\n"); - return; - } - - /* - * Ignore the 127.0.0.1 entry. - */ - if (IA_SIN(&ifaddr)->sin_addr.s_addr == htonl(0x7f000001)) - continue; - - writeAddr(FamilyInternet, 4, (CARD8 *)&(IA_SIN(&ifaddr)->sin_addr), - file, auth, ok); - - } - close(ipfd); -} - -#else /* WINTCP */ - #if defined(SIOCGIFCONF) || defined (SIOCGLIFCONF) -#if !defined(SYSV_SIOCGIFCONF) || defined(SIOCGLIFCONF) -# define ifioctl ioctl -#endif - #ifdef SIOCGLIFCONF # define ifr_type struct lifreq #else @@ -887,7 +772,7 @@ defineSelf(int fd, FILE *file, Xauth *auth, int *ok) ifc.ifc_len = sizeof(buf); ifc.ifc_buf = buf; #endif - if (ifioctl(fd, IFC_IOCTL_REQ, (char *)&ifc) < 0) { + if (ioctl(fd, IFC_IOCTL_REQ, (char *)&ifc) < 0) { logError("Trouble getting network interface configuration\n"); #if defined(SIOCGLIFNUM) && defined(SIOCGLIFCONF) if (bufptr != buf) @@ -1003,7 +888,6 @@ defineSelf(int fd, int file, int auth, int *ok) } #endif /* SIOCGIFCONF else */ -#endif /* WINTCP else */ #endif /* STREAMSCONN && !SYSV_SIOCGIFCONF else */ #endif /* HAVE_GETIFADDRS */ diff --git a/kdm/backend/choose.c b/kdm/backend/choose.c index cea7af18..9df43cb6 100644 --- a/kdm/backend/choose.c +++ b/kdm/backend/choose.c @@ -50,9 +50,6 @@ from the copyright holder. #include #ifdef STREAMSCONN -# ifdef WINTCP /* NCR with Wollongong TCP */ -# include -# endif # include # include # include @@ -474,10 +471,6 @@ emptyPingHosts(void) #define IFC_REQ(ifc) ifc.ifc_req -#ifndef SYSV_SIOCGIFCONF -# define ifioctl ioctl -#endif - static void registerBroadcastForPing(void) { @@ -493,47 +486,16 @@ registerBroadcastForPing(void) register struct ifreq *ifr; struct sockaddr broad_addr; char buf[2048], *cp, *cplim; -# ifdef WINTCP /* NCR with Wollongong TCP */ - int ipfd; - struct ifconf *ifcp; - struct strioctl ioc; - int n; - - ifcp = (struct ifconf *)buf; - ifcp->ifc_buf = buf + 4; - ifcp->ifc_len = sizeof(buf) - 4; - - if ((ipfd = open("/dev/ip", O_RDONLY)) < 0) { - t_error("RegisterBroadcastForPing() t_open(/dev/ip) failed"); - return; - } - - ioc.ic_cmd = IPIOC_GETIFCONF; - ioc.ic_timout = 60; - ioc.ic_len = sizeof(buf); - ioc.ic_dp = (char *)ifcp; - - if (ioctl(ipfd, (int)I_STR, (char *)&ioc) < 0) { - perror("RegisterBroadcastForPing() ioctl(I_STR(IPIOC_GETIFCONF)) failed"); - close(ipfd); - return; - } - - for (ifr = ifcp->ifc_req, n = ifcp->ifc_len / sizeof(struct ifreq); --n >= 0; ifr++) -# else /* WINTCP */ ifc.ifc_len = sizeof(buf); ifc.ifc_buf = buf; - if (ifioctl(socketFD, (int)SIOCGIFCONF, (char *)&ifc) < 0) + if (ioctl(socketFD, (int)SIOCGIFCONF, (char *)&ifc) < 0) return; cplim = (char *)IFC_REQ(ifc) + ifc.ifc_len; for (cp = (char *)IFC_REQ(ifc); cp < cplim; cp += ifr_size(ifr)) -# endif /* WINTCP */ { -# ifndef WINTCP ifr = (struct ifreq *)cp; -# endif if (ifr->ifr_addr.sa_family != AF_INET) continue; @@ -545,30 +507,12 @@ registerBroadcastForPing(void) struct ifreq broad_req; broad_req = *ifr; -# ifdef WINTCP /* NCR with Wollongong TCP */ - ioc.ic_cmd = IPIOC_GETIFFLAGS; - ioc.ic_timout = 0; - ioc.ic_len = sizeof(broad_req); - ioc.ic_dp = (char *)&broad_req; - - if (ioctl(ipfd, I_STR, (char *)&ioc) != -1 && -# else /* WINTCP */ - if (ifioctl(socketFD, SIOCGIFFLAGS, (char *)&broad_req) != -1 && -# endif /* WINTCP */ + if (ioctl(socketFD, SIOCGIFFLAGS, (char *)&broad_req) != -1 && (broad_req.ifr_flags & IFF_BROADCAST) && (broad_req.ifr_flags & IFF_UP)) { broad_req = *ifr; -# ifdef WINTCP /* NCR with Wollongong TCP */ - ioc.ic_cmd = IPIOC_GETIFBRDADDR; - ioc.ic_timout = 0; - ioc.ic_len = sizeof(broad_req); - ioc.ic_dp = (char *)&broad_req; - - if (ioctl(ipfd, I_STR, (char *)&ioc) != -1) -# else /* WINTCP */ - if (ifioctl(socketFD, SIOCGIFBRDADDR, (char *)&broad_req) != -1) -# endif /* WINTCP */ + if (ioctl(socketFD, SIOCGIFBRDADDR, (char *)&broad_req) != -1) broad_addr = broad_req.ifr_addr; else continue; diff --git a/kdm/backend/client.c b/kdm/backend/client.c index 91f5c1e1..9a2e2316 100644 --- a/kdm/backend/client.c +++ b/kdm/backend/client.c @@ -59,13 +59,7 @@ extern int key_setnet(struct key_netstarg *arg); # else # include # endif -#elif defined(_AIX) /* USE_PAM */ -# include -# include -extern int loginrestrictions(const char *Name, const int Mode, const char *Tty, char **Msg); -extern int loginfailed(const char *User, const char *Host, const char *Tty); -extern int loginsuccess(const char *User, const char *Host, const char *Tty, char **Msg); -#else /* USE_PAM || _AIX */ +#else /* USE_PAM */ # ifdef KERBEROS # include # include @@ -78,7 +72,7 @@ extern int loginsuccess(const char *User, const char *Host, const char *Tty, cha # include /* for expiration */ # include -#endif /* USE_PAM || _AIX */ +#endif /* USE_PAM */ #ifdef HAVE_GETSPNAM # include #endif @@ -112,8 +106,6 @@ struct login_cap *lc; #ifdef USE_PAM static pam_handle_t *pamh; static int inAuth; -#elif defined(_AIX) -static char tty[16], hostname[100]; #else # ifdef USESHADOW static struct spwd *sp; @@ -132,9 +124,9 @@ displayStr(int lv, const char *msg) gRecvInt(); } -#if (!defined(USE_PAM) && !defined(_AIX) \ +#if !defined(USE_PAM) \ && (defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(USESHADOW) \ - || (defined(KERBEROS) && defined(AFS)))) + || (defined(KERBEROS) && defined(AFS))) static void displayMsg(int lv, const char *msg, ...) { @@ -151,17 +143,12 @@ displayMsg(int lv, const char *msg, ...) } #endif -#ifdef _AIX -# define _ENDUSERDB , enduserdb() -#else -# define _ENDUSERDB -#endif #ifdef HAVE_GETSPNAM /* (sic!) - not USESHADOW */ # define _ENDSPENT , endspent() #else # define _ENDSPENT #endif -#define END_ENT endpwent() _ENDSPENT _ENDUSERDB +#define END_ENT endpwent() _ENDSPENT #define V_RET_NP \ do { \ @@ -444,7 +431,7 @@ doPAMAuth(const char *psrv, struct pam_data *pdata) #endif /* USE_PAM */ static int -#if defined(USE_PAM) || defined(_AIX) +#if defined(USE_PAM) isNoPassAllowed(const char *un) { struct passwd *pw; @@ -459,7 +446,7 @@ isNoPassAllowed(struct passwd *pw) char **fp; int hg; -#if defined(USE_PAM) || defined(_AIX) +#if defined(USE_PAM) if (!*un) return False; #endif @@ -467,7 +454,7 @@ isNoPassAllowed(struct passwd *pw) if (cursource != PWSRC_MANUAL) return True; -#if defined(USE_PAM) || defined(_AIX) +#if defined(USE_PAM) /* Give nss_ldap, etc. a chance to normalize (uppercase) the name. */ if (!(pw = getpwnam(un)) || pw->pw_passwd[0] == '!' || pw->pw_passwd[0] == '*') @@ -507,7 +494,7 @@ isNoPassAllowed(struct passwd *pw) return False; } -#if !defined(USE_PAM) && !defined(_AIX) && defined(HAVE_SETUSERCONTEXT) +#if !defined(USE_PAM) && defined(HAVE_SETUSERCONTEXT) # define LC_RET0 do { login_close(lc); V_RET; } while(0) #else # define LC_RET0 V_RET @@ -521,9 +508,6 @@ verify(GConvFunc gconv, int rootok) struct pam_data pdata; int pretc, pnopass; char psrvb[64]; -#elif defined(_AIX) - char *msg, *curret; - int i, reenter; #else struct stat st; const char *nolg; @@ -535,7 +519,7 @@ verify(GConvFunc gconv, int rootok) # if defined(HAVE_STRUCT_PASSWD_PW_EXPIRE) || defined(USESHADOW) int tim, expir, warntime, quietlog; # endif -# if !defined(ultrix) && !defined(__ultrix__) && (defined(HAVE_PW_ENCRYPT) || defined(HAVE_CRYPT)) +# if defined(HAVE_PW_ENCRYPT) || defined(HAVE_CRYPT) char *crpt_passwd; # endif #endif @@ -570,98 +554,6 @@ verify(GConvFunc gconv, int rootok) if (!doPAMAuth(psrv, &pdata)) return False; -#elif defined(_AIX) - - if ((td->displayType & d_location) == dForeign) { - char *tmpch; - strncpy(hostname, td->name, sizeof(hostname) - 1); - hostname[sizeof(hostname)-1] = '\0'; - if ((tmpch = strchr(hostname, ':'))) - *tmpch = '\0'; - } else { - hostname[0] = '\0'; - } - - /* tty names should only be 15 characters long */ -# if 0 - for (i = 0; i < 15 && td->name[i]; i++) { - if (td->name[i] == ':' || td->name[i] == '.') - tty[i] = '_'; - else - tty[i] = td->name[i]; - } - tty[i] = '\0'; -# else - memcpy(tty, "/dev/xdm/", 9); - for (i = 0; i < 6 && td->name[i]; i++) { - if (td->name[i] == ':' || td->name[i] == '.') - tty[9 + i] = '_'; - else - tty[9 + i] = td->name[i]; - } - tty[9 + i] = '\0'; -# endif - - if (!strcmp(curtype, "classic")) { - if (!gconv(GCONV_USER, 0)) - return False; - if (isNoPassAllowed(curuser)) { - gconv(GCONV_PASS_ND, 0); - if (!*curpass) { - debug("accepting despite empty password\n"); - goto done; - } - } else { - if (!gconv(GCONV_PASS, 0)) - V_RET_NP; - } - msg = 0; - if ((i = authenticate(curuser, curpass, &reenter, &msg))) { - debug("authenticate() failed: %s\n", msg); - free(msg); - loginfailed(curuser, hostname, tty); - if (i == ENOENT || i == ESAD) - V_RET_AUTH; - else - V_RET_FAIL(0); - } - if (reenter) { - logError("authenticate() requests more data: %s\n", msg); - free(msg); - V_RET_FAIL(0); - } - } else if (!strcmp(curtype, "generic")) { - if (!gconv(GCONV_USER, 0)) - return False; - for (curret = 0;;) { - msg = 0; - if ((i = authenticate(curuser, curret, &reenter, &msg))) { - debug("authenticate() failed: %s\n", msg); - free(msg); - loginfailed(curuser, hostname, tty); - if (i == ENOENT || i == ESAD) - V_RET_AUTH; - else - V_RET_FAIL(0); - } - free(curret); - if (!reenter) - break; - if (!(curret = gconv(GCONV_HIDDEN, msg))) - return False; - free(msg); - } - } else { - logError("Unsupported authentication type %\"s requested\n", curtype); - V_RET_FAIL(0); - } - if (msg) { - displayStr(V_MSG_INFO, msg); - free(msg); - } - - done: - #else if (strcmp(curtype, "classic")) { @@ -747,9 +639,7 @@ verify(GConvFunc gconv, int rootok) krbtkfile[0] = '\0'; # endif /* KERBEROS */ -# if defined(ultrix) || defined(__ultrix__) - if (authenticate_user(p, curpass, 0) < 0) -# elif defined(HAVE_PW_ENCRYPT) +# if defined(HAVE_PW_ENCRYPT) if (!(crpt_passwd = pw_encrypt(curpass, p->pw_passwd)) || strcmp(crpt_passwd, p->pw_passwd)) # elif defined(HAVE_CRYPT) if (!(crpt_passwd = crypt(curpass, p->pw_passwd)) || strcmp(crpt_passwd, p->pw_passwd)) @@ -763,11 +653,11 @@ verify(GConvFunc gconv, int rootok) done: -#endif /* !defined(USE_PAM) && !defined(_AIX) */ +#endif /* !defined(USE_PAM) */ debug("restrict %s ...\n", curuser); -#if defined(USE_PAM) || defined(_AIX) +#if defined(USE_PAM) if (!(p = getpwnam(curuser))) { logError("getpwnam(%s) failed.\n", curuser); V_RET_FAIL(0); @@ -829,27 +719,7 @@ verify(GConvFunc gconv, int rootok) V_RET_AUTH; } -#elif defined(_AIX) /* USE_PAM */ - - msg = 0; - if (loginrestrictions(curuser, - ((td->displayType & d_location) == dForeign) ? S_RLOGIN : S_LOGIN, - tty, &msg) == -1) { - debug("loginrestrictions() - %s\n", msg ? msg : "error"); - loginfailed(curuser, hostname, tty); - prepareErrorGreet(); - if (msg) { - displayStr(V_MSG_ERR, msg); - free(msg); - } - gSendInt(V_AUTH); - V_RET; - } - free(msg); - -#endif /* USE_PAM || _AIX */ - -#ifndef _AIX +#endif /* USE_PAM */ # ifdef HAVE_SETUSERCONTEXT # ifdef HAVE_LOGIN_GETCLASS @@ -1021,8 +891,6 @@ verify(GConvFunc gconv, int rootok) } # endif -#endif /* !_AIX */ - return True; } @@ -1030,9 +898,6 @@ verify(GConvFunc gconv, int rootok) static const char *envvars[] = { "TZ", /* SYSV and SVR4, but never hurts */ -#ifdef _AIX - "AUTHSTATE", /* for kerberos */ -#endif 0 }; @@ -1144,13 +1009,7 @@ changeUser(const char *user, const char *authfile) if (authfile && chown(authfile, pw->pw_uid, pw->pw_gid)) logWarn("chmod for %s failed: %m\n", authfile); -#ifdef AIXV3 - if (setpcred(user, NULL)) { - logError("setusercontext for %s failed: %m\n", user); - return False; - } - return True; -#elif defined(HAS_SETUSERCONTEXT) +#if defined(HAS_SETUSERCONTEXT) if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL)) { logError("setpcred for %s failed: %m\n", user); return False; @@ -1297,12 +1156,6 @@ startClient(volatile int *pid) char **saved_env; # endif int pretc; -#else -# ifdef _AIX - char *msg; - char **theenv; - extern char **newenv; /* from libs.a, this is set up by setpenv */ -# endif #endif char *failsafeArgv[2]; char *buf, *buf2; @@ -1314,7 +1167,7 @@ startClient(volatile int *pid) curdmrc = dmrcuser = 0; } -#if defined(USE_PAM) || defined(_AIX) +#if defined(USE_PAM) if (!(p = getpwnam(curuser))) { logError("getpwnam(%s) failed.\n", curuser); pError: @@ -1325,16 +1178,7 @@ startClient(volatile int *pid) strcpy(curuser, p->pw_name); /* Use normalized login name. */ -#ifndef USE_PAM -# ifdef _AIX - msg = 0; - loginsuccess(curuser, hostname, tty, &msg); - if (msg) { - debug("loginsuccess() - %s\n", msg); - free(msg); - } -# else /* _AIX */ -# if defined(KERBEROS) && defined(AFS) +#if !defined(USE_PAM) && defined(KERBEROS) && defined(AFS) if (krbtkfile[0] != '\0') { if (k_hasafs()) { int fail = False; @@ -1351,9 +1195,7 @@ startClient(volatile int *pid) "Warning: Problems during Kerberos4/AFS setup."); } } -# endif /* KERBEROS && AFS */ -# endif /* _AIX */ -#endif /* !PAM */ +#endif /* !PAM && KERBEROS && AFS*/ curuid = p->pw_uid; curgid = p->pw_gid; @@ -1372,7 +1214,7 @@ startClient(volatile int *pid) env = setEnv(env, "PATH", curuid ? td->userPath : td->systemPath); env = setEnv(env, "SHELL", p->pw_shell); env = setEnv(env, "HOME", p->pw_dir); -#if !defined(USE_PAM) && !defined(_AIX) && defined(KERBEROS) +#if !defined(USE_PAM) && defined(KERBEROS) if (krbtkfile[0] != '\0') env = setEnv(env, "KRBTKFILE", krbtkfile); #endif @@ -1530,9 +1372,6 @@ startClient(volatile int *pid) } /* Memory leaks are ok here as we exec() soon. */ - -#if defined(USE_PAM) || !defined(_AIX) - # ifdef USE_PAM /* pass in environment variables set by libpam and modules it called */ # ifdef HAVE_PAM_GETENVLIST @@ -1594,32 +1433,6 @@ startClient(volatile int *pid) # endif /* !HAVE_SETUSERCONTEXT */ -#else /* PAM || !_AIX */ - /* - * Set the user's credentials: uid, gid, groups, - * audit classes, user limits, and umask. - */ - if (setpcred(curuser, 0) == -1) { - logError("setpcred for %s failed: %m\n", curuser); - goto cError; - } - - /* - * Set the users process environment. Store protected variables and - * obtain updated user environment list. This call will initialize - * global 'newenv'. - */ - userEnviron = xCopyStrArr(1, userEnviron); - userEnviron[0] = (char *)"USRENVIRON:"; - if (setpenv(curuser, PENV_INIT | PENV_ARGV | PENV_NOEXEC, - userEnviron, 0) != 0) { - logError("Cannot set %s's process environment\n", curuser); - goto cError; - } - userEnviron = newenv; - -#endif /* _AIX */ - /* * for user-based authorization schemes, * use the password to get the user's credentials. @@ -1825,7 +1638,7 @@ clientExited(void) #ifdef K5AUTH krb5Destroy(td->name); #endif /* K5AUTH */ -#if !defined(USE_PAM) && !defined(_AIX) +#if !defined(USE_PAM) # ifdef KERBEROS if (krbtkfile[0]) { (void)dest_tkt(); @@ -1835,7 +1648,7 @@ clientExited(void) # endif } # endif -#endif /* !USE_PAM && !_AIX*/ +#endif /* !USE_PAM */ } exit(0); case -1: diff --git a/kdm/backend/dm.c b/kdm/backend/dm.c index 77a2ef7f..20ec18a5 100644 --- a/kdm/backend/dm.c +++ b/kdm/backend/dm.c @@ -1178,9 +1178,6 @@ sigHandler(int n) char buf = (char)n; /* debug("caught signal %d\n", n); this hangs in syslog() */ write(signalFds[1], &buf, 1); -#ifdef __EMX__ - (void)Signal(n, sigHandler); -#endif errno = olderrno; } diff --git a/kdm/backend/dm.h b/kdm/backend/dm.h index b2f8c619..8a9e817c 100644 --- a/kdm/backend/dm.h +++ b/kdm/backend/dm.h @@ -61,10 +61,6 @@ from the copyright holder. extern char **environ; #ifdef XDMCP -# if defined(__osf__) -/* someone somewhere defines QUERY under Tru64 which confuses Xdmcp.h */ -# undef QUERY -# endif # include #endif @@ -92,7 +88,7 @@ extern char **environ; #define wcSig(w) (((w) >> 8) & 0xff) #include -#if defined(__EMX__) || (defined(__NetBSD__) && defined(__sparc__)) /* XXX netbsd? */ +#if defined(__NetBSD__) && defined(__sparc__) /* XXX netbsd? */ # define Setjmp(e) setjmp(e) # define Longjmp(e,v) longjmp(e,v) # define Jmp_buf jmp_buf diff --git a/kdm/backend/dm_socket.h b/kdm/backend/dm_socket.h index 1fd8214a..cd4fde4a 100644 --- a/kdm/backend/dm_socket.h +++ b/kdm/backend/dm_socket.h @@ -34,35 +34,20 @@ authorization. #ifndef _DM_SOCKET_H_ #define _DM_SOCKET_H_ 1 -#ifndef __Lynx__ -# include -#else -# include -#endif +#include #ifdef TCPCONN # include #endif #ifdef UNIXCONN -# ifndef __Lynx__ -# include -# else -# include -# endif +# include #endif #ifdef DNETCONN # include #endif -#if (defined(__svr4__) && !defined(__sun__)) && defined(SIOCGIFCONF) -# define SYSV_SIOCGIFCONF -int ifioctl(int fd, int cmd, char *arg); -#else -# define ifioctl ioctl -#endif - #ifdef BSD # if (BSD >= 199103) # define VARIABLE_IFREQ diff --git a/kdm/backend/netaddr.c b/kdm/backend/netaddr.c index 53907a90..6f62af44 100644 --- a/kdm/backend/netaddr.c +++ b/kdm/backend/netaddr.c @@ -154,12 +154,10 @@ convertAddr(char *saddr, int *len, CARD8 **addr) break; #endif #ifdef AF_UNIX -#ifndef __hpux case AF_UNIX: retval = FamilyLocal; break; #endif -#endif #ifdef TCPCONN case AF_INET: retval = FamilyInternet; diff --git a/kdm/backend/process.c b/kdm/backend/process.c index 7f6443e8..c92689d4 100644 --- a/kdm/backend/process.c +++ b/kdm/backend/process.c @@ -52,7 +52,6 @@ from the copyright holder. SIGFUNC Signal(int sig, SIGFUNC handler) { -#ifndef __EMX__ struct sigaction sigact, osigact; sigact.sa_handler = handler; sigemptyset(&sigact.sa_mask); @@ -63,9 +62,6 @@ SIGFUNC Signal(int sig, SIGFUNC handler) # endif sigaction(sig, &sigact, &osigact); return osigact.sa_handler; -#else - return signal(sig, handler); -#endif } void diff --git a/kdm/backend/sessreg.c b/kdm/backend/sessreg.c index 9cbfff4d..4529d12f 100644 --- a/kdm/backend/sessreg.c +++ b/kdm/backend/sessreg.c @@ -39,13 +39,8 @@ from The Open Group. #include "dm.h" #include "dm_error.h" -#if defined(__svr4__) || defined(__Lynx__) || defined(__QNX__) || defined(__APPLE__) || defined(_SEQUENT_) /*|| defined(USE_PAM)*/ -# define NO_LASTLOG -#endif -#ifdef __FreeBSD__ -# if __FreeBSD_version >= 900007 +#if defined(__FreeBSD__) && __FreeBSD_version >= 900007 # define NO_LASTLOG -# endif #endif #ifndef NO_LASTLOG @@ -76,13 +71,6 @@ from The Open Group. # endif #endif -#ifdef _AIX -# define UTL_PFX "xdm/" -# define UTL_OFF strlen(UTL_PFX) -#else -# define UTL_OFF 0 -#endif - #ifndef BSD_UTMP static unsigned crc32s(const char *str) @@ -161,7 +149,7 @@ sessreg(struct display *d, int pid, const char *user, int uid) colon = strchr(d->name, ':'); clen = strlen(colon); - if (clen > (int)(sizeof(ut_ent.ut_line) - UTL_OFF) - 2) + if (clen > (int)(sizeof(ut_ent.ut_line)) - 2) return; /* uhm, well ... */ if (colon == d->name) { #ifndef BSD_UTMP @@ -195,7 +183,7 @@ sessreg(struct display *d, int pid, const char *user, int uid) c < 52 ? c - 26 + 'a' : c - 52 + '0'; } #endif - left = sizeof(ut_ent.ut_line) - UTL_OFF - clen; + left = sizeof(ut_ent.ut_line) - clen; if (colon - d->name <= left) { clen += colon - d->name; colon = d->name; @@ -203,26 +191,23 @@ sessreg(struct display *d, int pid, const char *user, int uid) } else { dot = strchr(d->name, '.'); if (dot && dot - d->name < left) { - memcpy(ut_ent.ut_line + UTL_OFF, d->name, left - 1); - ut_ent.ut_line[UTL_OFF + left - 1] = '~'; + memcpy(ut_ent.ut_line, d->name, left - 1); + ut_ent.ut_line[left - 1] = '~'; } else { - memcpy(ut_ent.ut_line + UTL_OFF, d->name, left / 2 - 1); - ut_ent.ut_line[UTL_OFF + left/2 - 1] = '~'; + memcpy(ut_ent.ut_line, d->name, left / 2 - 1); + ut_ent.ut_line[left/2 - 1] = '~'; if (dot) { - memcpy(ut_ent.ut_line + UTL_OFF + left / 2, + memcpy(ut_ent.ut_line + left / 2, dot - (left - left / 2 - 1), left - left / 2 - 1); - ut_ent.ut_line[UTL_OFF + left - 1] = '~'; + ut_ent.ut_line[left - 1] = '~'; } else - memcpy(ut_ent.ut_line + UTL_OFF + left / 2, + memcpy(ut_ent.ut_line + left / 2, colon - (left - left / 2), left - left / 2); } } } -#ifdef UTL_PFX - memcpy(ut_ent.ut_line, UTL_PFX, UTL_OFF); -#endif - memcpy(ut_ent.ut_line + UTL_OFF + left, colon, clen); + memcpy(ut_ent.ut_line + left, colon, clen); #ifndef NO_UTMP # ifdef BSD_UTMP @@ -322,17 +307,4 @@ sessreg(struct display *d, int pid, const char *user, int uid) #else (void)uid; #endif - -#ifdef UTL_PFX - { - char tmp[sizeof("/dev/") + sizeof(ut_ent.ut_line)]; - mkdir("/dev/" UTL_PFX, 0755); - chmod("/dev/" UTL_PFX, 0755); - sprintf(tmp, "/dev/%.*s", sizeof(ut_ent.ut_line), ut_ent.ut_line); - if (pid) - close(creat(tmp, 0644)); - else - unlink(tmp); - } -#endif } diff --git a/kdm/backend/util.c b/kdm/backend/util.c index e2b31dfd..814b68dc 100644 --- a/kdm/backend/util.c +++ b/kdm/backend/util.c @@ -46,10 +46,6 @@ from the copyright holder. #include #include -#if 0 /*def USG; this was hpux once upon a time */ -# define NEED_UTSNAME -#endif - #ifdef NEED_UTSNAME # include #endif diff --git a/kdm/backend/xdmcp.c b/kdm/backend/xdmcp.c index c39e0fe2..5e1f0e4d 100644 --- a/kdm/backend/xdmcp.c +++ b/kdm/backend/xdmcp.c @@ -645,7 +645,7 @@ forward_respond(struct sockaddr *from, int fromlen ATTR_UNUSED, memmove(un_addr.sun_path, clientAddress.data, clientAddress.length); un_addr.sun_path[clientAddress.length] = '\0'; client = (struct sockaddr *)&un_addr; -#if defined(HAVE_STRUCT_SOCKADDR_IN_SIN_LEN) && !defined(__Lynx__) && defined(UNIXCONN) +#if defined(HAVE_STRUCT_SOCKADDR_IN_SIN_LEN) && defined(UNIXCONN) un_addr.sun_len = strlen(un_addr.sun_path); clientlen = SUN_LEN(&un_addr); #else diff --git a/kdm/config.def b/kdm/config.def index 1fbbbf51..e33723a8 100644 --- a/kdm/config.def +++ b/kdm/config.def @@ -34,10 +34,7 @@ #include /* for #define BSD */ -#ifdef _AIX -# define HALT_CMD "/usr/sbin/shutdown -h now" -# define REBOOT_CMD "/usr/sbin/shutdown -r now" -#elif defined(__linux__) +#if defined(__linux__) # define HALT_CMD "/sbin/poweroff" # define REBOOT_CMD "/sbin/reboot" #elif defined(BSD) @@ -68,17 +65,11 @@ #ifdef HAVE_VTS #elif defined(__sun__) # define DEF_SERVER_TTY "console" -#elif defined(_AIX) -# define DEF_SERVER_TTY "lft0" #else # define DEF_SERVER_TTY "" #endif -#ifdef _AIX -# define DEF_SERVER_CMD XBINDIR "/X -T -force" -#else -# define DEF_SERVER_CMD XBINDIR "/X" -#endif +#define DEF_SERVER_CMD XBINDIR "/X" # The contents of this section are copied mostly verbatim to the diff --git a/kdm/kfrontend/genkdmconf.c b/kdm/kfrontend/genkdmconf.c index 9f0a21b3..669bea1a 100644 --- a/kdm/kfrontend/genkdmconf.c +++ b/kdm/kfrontend/genkdmconf.c @@ -1809,37 +1809,10 @@ edit_startup(File *file) chg1 = True; if (oldver < 0x0203) { chg2 = -#ifdef _AIX - delstr(file, "\n" -"# We create a pseudodevice for finger. (host:0 becomes [kx]dm/host_0)\n"); -"# Without it, finger errors out with \"Cannot stat /dev/host:0\".\n" -"#\n" -"if [[] -f /usr/lib/X11/xdm/sessreg ]; then\n" -" devname=`echo $DISPLAY | /usr/bin/sed -e 's/[[]:\\.]/_/g' | /usr/bin/cut -c1-8`\n" -" hostname=`echo $DISPLAY | /usr/bin/cut -d':' -f1`\n" -"\n" -" if [[] -z \"$devname\" ]; then\n" -" devname=\"unknown\"\n" -" fi\n" -" if [[] ! -d /dev/[kx]dm ]; then\n" -" /usr/bin/mkdir /dev/[kx]dm\n" -" /usr/bin/chmod 755 /dev/[kx]dm\n" -" fi\n" -" /usr/bin/touch /dev/[kx]dm/$devname\n" -" /usr/bin/chmod 644 /dev/[kx]dm/$devname\n" -"\n" -" if [[] -z \"$hostname\" ]; then\n" -" exec /usr/lib/X11/xdm/sessreg -a -l [kx]dm/$devname $USER\n" -" else\n" -" exec /usr/lib/X11/xdm/sessreg -a -l [kx]dm/$devname -h $hostname $USER\n" -" fi\n" -"fi\n") | -#else # ifdef BSD delstr(file, "\n" "exec sessreg -a -l $DISPLAY -x */Xservers -u " _PATH_UTMP " $USER\n") | # endif -#endif /* _AIX */ delstr(file, "\n" "exec sessreg -a -l $DISPLAY" #ifdef BSD @@ -1877,18 +1850,10 @@ static int edit_reset(File *file) { return -#ifdef _AIX - delstr(file, "\n" -"if [[] -f /usr/lib/X11/xdm/sessreg ]; then\n" -" devname=`echo $DISPLAY | /usr/bin/sed -e 's/[[]:\\.]/_/g' | /usr/bin/cut -c1-8`\n" -" exec /usr/lib/X11/xdm/sessreg -d -l [kx]dm/$devname $USER\n" -"fi\n") | -#else # ifdef BSD delstr(file, "\n" "exec sessreg -d -l $DISPLAY -x */Xservers -u " _PATH_UTMP " $USER\n") | # endif -#endif /* _AIX */ delstr(file, "\n" "exec sessreg -d -l $DISPLAY" # ifdef BSD diff --git a/kdm/kfrontend/kconsole.cpp b/kdm/kfrontend/kconsole.cpp index a2bc4b88..7d705537 100644 --- a/kdm/kfrontend/kconsole.cpp +++ b/kdm/kfrontend/kconsole.cpp @@ -45,12 +45,10 @@ extern "C" { #include } #endif -#if !defined(__osf__) #ifdef HAVE_TERMIO_H /* needed at least on AIX */ #include #endif -#endif #if defined (_HPUX_SOURCE) #define _TERMIOS_INCLUDED diff --git a/kglobalaccel/main.cpp b/kglobalaccel/main.cpp index c0815461..ea98735e 100644 --- a/kglobalaccel/main.cpp +++ b/kglobalaccel/main.cpp @@ -93,11 +93,8 @@ int main(int argc, char **argv) app.setQuitOnLastWindowClosed( false ); // Stop gracefully - //There is no SIGINT and SIGTERM under wince -#ifndef _WIN32_WCE KDE_signal(SIGINT, sighandler); KDE_signal(SIGTERM, sighandler); -#endif KDE_signal(SIGHUP, sighandler); // Restart on a crash diff --git a/kinfocenter/Modules/base/info_aix.cpp b/kinfocenter/Modules/base/info_aix.cpp deleted file mode 100644 index 91375713..00000000 --- a/kinfocenter/Modules/base/info_aix.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/* -Copyright 2010 Reza Arbab - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#define class _class -#include -#include -#include -#undef class -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -char * device_description(struct CuDv *cudv) { - char *desc= NULL; - struct PdDv *pddv = cudv->PdDvLn; /* link to Predefined Devices database */ - nl_catd cat; - - cat = catopen("/usr/lib/methods/devices.cat", NL_CAT_LOCALE); - if ((int)cat == -1) - return NULL; - - desc = strdup(catgets(cat, pddv->setno, pddv->msgno, "N/A") ); - catclose(cat); - - return desc; -} - -bool list_devices(QListView *lBox, char *criteria) { - struct CuDv *cudv; /* Customized Devices */ - struct listinfo info; - int i; - char *cudv_desc; - QString cudv_status; - QListViewItem *lastitem= NULL; - - lBox->addColumn(i18n("Name")); - lBox->addColumn(i18n("Status")); - lBox->addColumn(i18n("Location")); - lBox->addColumn(i18n("Description")); - - if (odm_initialize() == -1) { - kError(0) << "odm_initialize() failed: odmerrno = " << odmerrno << endl; - return (false); - } - - cudv = (struct CuDv *) odm_get_list(CuDv_CLASS, criteria, &info, 100, 2); - - if ((int)cudv == -1) { - odm_terminate(); - kError(0) << "odm_get_list() failed: odmerrno = " << odmerrno << endl; - return (false); - } else if (!cudv) /* empty list */ - { - odm_terminate(); - return (true); - } - - for (i=0; i tosize) /* E.g., from 2048 to 512. */ - return blocks * (fromsize / tosize); - else - /* E.g., from 256 to 512. */ - return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize); -} - -/* Fill in the fields of FSP with information about space usage for - the filesystem on which PATH resides. - Return 0 if successful, -1 if not. */ - -#define CONVERT_BLOCKS(b) fs_adjust_blocks ((b), fsd.f_bsize, 512) - -static int get_fs_usage(char *path, long *l_total, long *l_avail) { - struct statfs fsd; /* 4.3BSD, SunOS 4, HP-UX, AIX. */ - unsigned long fsu_blocks, fsu_bfree, fsu_bavail; - - *l_total = *l_avail = 0; - if (statfs(path, &fsd) < 0) - return -1; - - fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks); - fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree); - fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail); - - *l_avail = getuid() ? fsu_bavail/2 : fsu_bfree/2; - *l_total = fsu_blocks/2; - - return 0; -} diff --git a/kinfocenter/Modules/base/info_hpux.cpp b/kinfocenter/Modules/base/info_hpux.cpp deleted file mode 100644 index 69ef7a90..00000000 --- a/kinfocenter/Modules/base/info_hpux.cpp +++ /dev/null @@ -1,240 +0,0 @@ - -/* -Copyright 1998 Helge Deller deller@gmx.de - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of -the License or (at your option) version 3 or any later version -accepted by the membership of KDE e.V. (or its successor approved -by the membership of KDE e.V.), which shall act as a proxy -defined in Section 14 of version 3 of the license. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -# define INFO_PCI "" // Please, who know it ???? -# define INFO_PCI_EISA "/etc/eisa/system.sci" // File ! -# define INFO_IOPORTS_1 "/etc/dmesg" // as pipe ! -# define INFO_IOPORTS_2 "/usr/sbin/dmesg" // as pipe ! -# define INFO_DEVICES "/etc/ioscan" // as pipe !! - -/* The following table is from an HP-UX 10.20 System - build out of the files - "/usr/lib/sched.models" - or - "/opt/langtools/lib/sched.models" - If you have more entries, then please add them or send them to me! - */ - -// entries for PA_REVISION[] -enum V_ENTRIES -{ V_1x0, - V_1x1, V_1x1a, V_1x1b, V_1x1c, V_1x1d, V_1x1e, - V_2x0, - V_LAST}; - -static const char PA_REVISION[V_LAST][7] = { "1.0", "1.1", "1.1a", "1.1b", "1.1c", "1.1d", "1.1e", "2.0" }; - -// entries for PA_NAME[] -enum PA_ENTRIES -{ PA7000, - PA7100, PA7100LC, PA7200, PA7300, - PA8000, PA8200, PA8500, - PARISC_PA_LAST}; - -static const char PA_NAME[PARISC_PA_LAST][11] = { "PA7000", "PA7100", "PA7100LC", "PA7200", "PA7300", "PA8000", "PA8200", "PA8500" }; - -struct _type_LOOKUPTABLE { - char Name[8]; - unsigned short parisc_rev; // = enum V_ENTRIES - unsigned short parisc_name; // = enum PA_ENTRIES -}; - -static const struct _type_LOOKUPTABLE PA_LOOKUPTABLE[] = { -/* VERSION A.00.07 - (there seems to exist several different files with same version-number !)*/ -{ "600", V_1x0, PA7000 }, { "635", V_1x0, PA7000 }, { "645", V_1x0, PA7000 }, { "700", V_1x1, PA7000 }, { "705", V_1x1a, PA7000 }, { "710", V_1x1a, PA7000 }, { "712", V_1x1c, PA7100LC }, { "715", V_1x1c, PA7100LC }, { "720", V_1x1a, PA7000 }, { "722", V_1x1c, PA7100LC }, - { "725", V_1x1c, PA7100LC }, { "728", V_1x1d, PA7200 }, { "730", V_1x1a, PA7000 }, { "735", V_1x1b, PA7100 }, - { "742", V_1x1b, PA7100 }, - { "743", V_1x1b, PA7100 }, // or a 1.1c,PA7100LC !! - { "744", V_1x1e, PA7300 }, { "745", V_1x1b, PA7100 }, { "747", V_1x1b, PA7100 }, { "750", V_1x1a, PA7000 }, { "755", V_1x1b, PA7100 }, { "770", V_1x1d, PA7200 }, { "777", V_1x1d, PA7200 }, { "778", V_1x1e, PA7300 }, { "779", V_1x1e, PA7300 }, { "780", V_2x0, PA8000 }, - { "781", V_2x0, PA8000 }, { "782", V_2x0, PA8200 }, { "783", V_2x0, PA8500 }, { "785", V_2x0, PA8500 }, - { "800", V_1x0, PA7000 }, // and one with: 2.0 / PA8000 - { "801", V_1x1c, PA7100LC }, { "802", V_2x0, PA8000 }, { "803", V_1x1e, PA7300 }, { "804", V_2x0, PA8000 }, { "806", V_1x1c, PA7100LC }, { "807", V_1x1a, PA7000 }, { "808", V_1x0, PA7000 }, { "809", V_1x1d, PA7200 }, { "810", V_2x0, PA8000 }, { "811", V_1x1c, PA7100LC }, { "813", V_1x1e, - PA7300 }, { "815", V_1x0, PA7000 }, { "816", V_1x1c, PA7100LC }, { "817", V_1x1a, PA7000 }, { "819", V_1x1d, PA7200 }, { "820", V_2x0, PA8000 }, { "821", V_1x1d, PA7200 }, { "822", V_1x0, PA7000 }, { "825", V_1x0, PA7000 }, { "826", V_1x1c, PA7100LC }, { "827", V_1x1a, PA7000 }, { - "829", V_1x1d, PA7200 }, { "831", V_1x1d, PA7200 }, { "832", V_1x0, PA7000 }, { "834", V_1x0, PA7000 }, { "835", V_1x0, PA7000 }, { "837", V_1x1a, PA7000 }, { "839", V_1x1d, PA7200 }, { "840", V_1x0, PA7000 }, { "841", V_1x1d, PA7200 }, { "842", V_1x0, PA7000 }, { "845", V_1x0, - PA7000 }, { "847", V_1x1a, PA7000 }, { "849", V_1x1d, PA7200 }, { "850", V_1x0, PA7000 }, { "851", V_1x1d, PA7200 }, { "852", V_1x0, PA7000 }, { "855", V_1x0, PA7000 }, { "856", V_1x1c, PA7100LC }, { "857", V_1x1a, PA7000 }, { "859", V_1x1d, PA7200 }, { "860", V_1x0, PA7000 }, { - "861", V_2x0, PA8000 }, { "865", V_1x0, PA7000 }, { "869", V_1x1d, PA7200 }, { "870", V_1x0, PA7000 }, { "871", V_2x0, PA8000 }, { "877", V_1x1a, PA7000 }, { "879", V_2x0, PA8000 }, { "887", V_1x1b, PA7100 }, { "889", V_2x0, PA8000 }, { "890", V_1x0, PA7000 }, { "891", V_1x1b, - PA7100 }, { "892", V_1x1b, PA7100 }, { "893", V_2x0, PA8000 }, { "895", V_2x0, PA8000 }, { "896", V_2x0, PA8000 }, { "897", V_1x1b, PA7100 }, { "898", V_2x0, PA8200 }, { "899", V_2x0, PA8200 }, { "900", V_1x0, PA7000 }, { "B115", V_1x1e, PA7300 }, { "B120", V_1x1e, PA7300 }, { - "B132L", V_1x1e, PA7300 }, { "B160L", V_1x1e, PA7300 }, { "B180L", V_1x1e, PA7300 }, { "C100", V_1x1d, PA7200 }, { "C110", V_1x1d, PA7200 }, { "C115", V_1x1e, PA7300 }, { "C120", V_1x1e, PA7300 }, { "C130", V_2x0, PA8000 }, { "C140", V_2x0, PA8000 }, { "C160L", V_1x1e, PA7300 }, { - "C160", V_2x0, PA8000 }, { "C180L", V_1x1e, PA7300 }, { "C180-XP", V_2x0, PA8000 }, { "C180", V_2x0, PA8000 }, { "C200+", V_2x0, PA8200 }, { "C230+", V_2x0, PA8200 }, { "C240+", V_2x0, PA8200 }, { "CB260", V_2x0, PA8200 }, - { "D200", V_1x1d, PA7200 }, // or: 1.1c, PA7100LC - { "D210", V_1x1d, PA7200 }, // or: 1.1c, PA7100LC - { "D220", V_1x1e, PA7300 }, { "D230", V_1x1e, PA7300 }, { "D250", V_1x1d, PA7200 }, { "D260", V_1x1d, PA7200 }, { "D270", V_2x0, PA8000 }, { "D280", V_2x0, PA8000 }, { "D310", V_1x1c, PA7100LC }, { "D320", V_1x1e, PA7300 }, { "D330", V_1x1e, PA7300 }, { "D350", V_1x1d, PA7200 }, { "D360", - V_1x1d, PA7200 }, { "D370", V_2x0, PA8000 }, { "D380", V_2x0, PA8000 }, { "D400", V_1x1d, PA7200 }, { "D410", V_1x1d, PA7200 }, { "D650", V_2x0, PA8000 }, { "DX0", V_1x1c, PA7100LC }, { "DX5", V_1x1c, PA7100LC }, { "DXO", V_1x1c, PA7100LC }, { "E25", V_1x1c, PA7100LC }, { "E35", - V_1x1c, PA7100LC }, { "E45", V_1x1c, PA7100LC }, { "E55", V_1x1c, PA7100LC }, { "F10", V_1x1a, PA7000 }, { "F20", V_1x1a, PA7000 }, { "F30", V_1x1a, PA7000 }, { "G30", V_1x1a, PA7000 }, { "G40", V_1x1a, PA7000 }, { "G50", V_1x1b, PA7100 }, { "G60", V_1x1b, PA7100 }, { "G70", V_1x1b, - PA7100 }, { "H20", V_1x1a, PA7000 }, { "H30", V_1x1a, PA7000 }, { "H40", V_1x1a, PA7000 }, { "H50", V_1x1b, PA7100 }, { "H60", V_1x1b, PA7100 }, { "H70", V_1x1b, PA7100 }, { "I30", V_1x1a, PA7000 }, { "I40", V_1x1a, PA7000 }, { "I50", V_1x1b, PA7100 }, { "I60", V_1x1b, PA7100 }, { - "I70", V_1x1b, PA7100 }, { "J200", V_1x1d, PA7200 }, { "J210XC", V_1x1d, PA7200 }, { "J210", V_1x1d, PA7200 }, { "J220", V_2x0, PA8000 }, { "J2240", V_2x0, PA8200 }, { "J280", V_2x0, PA8000 }, { "J282", V_2x0, PA8000 }, { "J400", V_2x0, PA8000 }, { "J410", V_2x0, PA8000 }, { "K100", - V_1x1d, PA7200 }, { "K200", V_1x1d, PA7200 }, { "K210", V_1x1d, PA7200 }, { "K230", V_1x1d, PA7200 }, { "K250", V_2x0, PA8000 }, { "K260", V_2x0, PA8000 }, { "K370", V_2x0, PA8200 }, { "K380", V_2x0, PA8200 }, { "K400", V_1x1d, PA7200 }, { "K410", V_1x1d, PA7200 }, { "K420", V_1x1d, - PA7200 }, { "K430", V_1x1d, PA7200 }, { "K450", V_2x0, PA8000 }, { "K460", V_2x0, PA8000 }, { "K470", V_2x0, PA8200 }, { "K570", V_2x0, PA8200 }, { "K580", V_2x0, PA8200 }, { "S700i", V_1x1e, PA7300 }, { "S715", V_1x1e, PA7300 }, { "S744", V_1x1e, PA7300 }, - { "S760", V_1x1e, PA7300 }, { "T500", V_1x1c, PA7100LC }, // or: 1.1b, PA7100 - { "T520", V_1x1b, PA7100 }, { "T540", V_2x0, PA8000 }, { "T600", V_2x0, PA8000 }, { "V2000", V_2x0, PA8000 }, { "V2200", V_2x0, PA8200 }, { "V2250", V_2x0, PA8200 }, { "V2500", V_2x0, PA8500 }, - - { "", 0, 0 } /* Last Entry has to be empty. */ -}; - -/* Helper-Functions */ - -// Value() is defined in info.cpp !!! - -static bool Find_in_LOOKUPTABLE(QListView *lBox, char *machine) { - char *Machine; - int len; - const struct _type_LOOKUPTABLE *Entry = PA_LOOKUPTABLE; - QString str; - QListViewItem* olditem = 0; - - Machine = machine; // machine is like: "9000/715/D" - while ((*Machine) && (*Machine!='/')) - ++Machine; - - if (*Machine) - ++Machine; - else - Machine=machine; - - len = strlen(Machine); - - while (Entry->Name[0]) { - if (strncmp(Entry->Name, Machine, len)==0) { - olditem = new QListViewItem(lBox, olditem, i18n("PA-RISC Processor"), - QString(PA_NAME[Entry->parisc_name])); - olditem = new QListViewItem(lBox, olditem, i18n("PA-RISC Revision"), - QString("PA-RISC ") + QString(PA_REVISION[Entry->parisc_rev])); - return true; - } else - ++Entry; // next Entry ! - } - - return false; -} - -/* all following functions should return true, when the Information - was filled into the lBox-Widget. - returning false indicates, that information was not available. - */ - -bool GetInfo_ReadfromFile(QListView *lBox, const char *Name) { - char buf[2048]; - - QFile *file = new QFile(Name); - QListViewItem* olditem = 0; - - if (!file->open(QIODevice::ReadOnly)) { - delete file; - return false; - } - - while (file->readLine(buf, sizeof(buf)-1) >= 0) { - if (strlen(buf)) - olditem = new QListViewItem(lBox, olditem, QString::fromLocal8Bit(buf)); - } - - file->close(); - delete file; - return (lBox->childCount()); -} - -bool GetInfo_IRQ(QListView *) { - return false; -} - -bool GetInfo_DMA(QListView *) { - return false; -} - -bool GetInfo_PCI(QTreeWidget* tree) { - return (GetInfo_ReadfromFile(tree, INFO_PCI) + GetInfo_ReadfromFile(tree, INFO_PCI_EISA) ); -} - -bool GetInfo_IO_Ports(QListView *lBox) { - if (GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_1, false)) - return true; - else - return GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_2, false); -} - -bool GetInfo_SCSI(QListView *lBox) { - return GetInfo_ReadfromPipe(lBox, INFO_DEVICES, false); -} -/* Parts taken from fsusage.c from the Midnight Commander (mc) - - Copyright (C) 1991, 1992 Free Software Foundation, In - - Return the number of TOSIZE-byte blocks used by - BLOCKS FROMSIZE-byte blocks, rounding away from zero. - TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */ - -static long fs_adjust_blocks(long blocks, int fromsize, int tosize) { - if (tosize <= 0) - abort(); - if (fromsize <= 0) - return -1; - - if (fromsize == tosize) /* E.g., from 512 to 512. */ - return blocks; - else if (fromsize > tosize) /* E.g., from 2048 to 512. */ - return blocks * (fromsize / tosize); - else - /* E.g., from 256 to 512. */ - return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize); -} - -/* Fill in the fields of FSP with information about space usage for - the filesystem on which PATH resides. - Return 0 if successful, -1 if not. */ - -#define CONVERT_BLOCKS(b) fs_adjust_blocks ((b), fsd.f_bsize, 512) - -static int get_fs_usage(char *path, long *l_total, long *l_avail) { - struct statfs fsd; /* 4.3BSD, SunOS 4, HP-UX, AIX. */ - unsigned long fsu_blocks, fsu_bfree, fsu_bavail; - - *l_total = *l_avail = 0; - if (statfs(path, &fsd) < 0) - return -1; - - fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks); - fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree); - fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail); - - *l_avail = getuid() ? fsu_bavail/2 : fsu_bfree/2; - *l_total = fsu_blocks/2; - - return 0; -} - -bool GetInfo_XServer_and_Video(QListView *lBox) { - lBox = lBox; - return GetInfo_XServer_Generic(lBox); -} diff --git a/kinfocenter/Modules/base/info_osx.cpp b/kinfocenter/Modules/base/info_osx.cpp deleted file mode 100644 index b1e32a1f..00000000 --- a/kinfocenter/Modules/base/info_osx.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2003 Benjamin Reed - * - * info_osx.cpp is part of the KDE program kcminfo. Copied wholesale - * from info_fbsd.cpp =) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * all following functions should return true, when the Information - * was filled into the lBox-Widget. Returning false indicates that - * information was not available. - */ - -#include -#include - -#include -#include -#include - -#include - -#include -#include - -#include - -#include - -#include -#include - -#include - -bool GetInfo_IRQ(QTreeWidget*) { - return false; -} - -bool GetInfo_DMA(QTreeWidget*) { - return false; -} - -bool GetInfo_PCI(QTreeWidget*) { - return false; -} - -bool GetInfo_IO_Ports(QTreeWidget*) { - return false; -} - -bool GetInfo_SCSI(QTreeWidget*) { - return false; -} - -bool GetInfo_XServer_and_Video(QTreeWidget* tree) { -#ifdef Q_WS_X11 - return GetInfo_XServer_Generic(tree); -#else - return false; -#endif -} diff --git a/kinfocenter/Modules/base/info_sgi.cpp b/kinfocenter/Modules/base/info_sgi.cpp deleted file mode 100644 index 66357385..00000000 --- a/kinfocenter/Modules/base/info_sgi.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* info_sgi.cpp - - !!!!! this file will be included by info.cpp !!!!! - */ - -/* all following functions should return true, when the Information - was filled into the lBox-Widget. - returning false indicates, that information was not available. - */ - -#include - -bool GetInfo_IRQ(QListView *) { - return false; -} - -bool GetInfo_DMA(QListView *) { - return false; -} - -bool GetInfo_PCI(QTreeWidget*) { - return false; -} - -bool GetInfo_IO_Ports(QListView *) { - return false; -} - -bool GetInfo_SCSI(QListView *) { - return false; -} - -bool GetInfo_XServer_and_Video(QListView *lBox) { - return GetInfo_XServer_Generic(lBox); -} - diff --git a/kinfocenter/Modules/base/os_current.cpp b/kinfocenter/Modules/base/os_current.cpp index 995bc4c6..dd8986e3 100644 --- a/kinfocenter/Modules/base/os_current.cpp +++ b/kinfocenter/Modules/base/os_current.cpp @@ -25,22 +25,14 @@ License along with this library. If not, see . #ifdef __linux__ #include "info_linux.cpp" -#elif defined(sgi) && sgi - #include "info_sgi.cpp" #elif defined(__FreeBSD__) || defined(__DragonFly__) #include "info_fbsd.cpp" -#elif defined(__hpux) - #include "info_hpux.cpp" #elif defined(__NetBSD__) #include "info_netbsd.cpp" #elif defined(__OpenBSD__) #include "info_openbsd.cpp" -#elif defined(__svr4__) && defined(sun) +#elif defined(sun) #include "info_solaris.cpp" -#elif defined(_AIX) - #include "info_aix.cpp" -#elif defined(__APPLE__) - #include "info_osx.cpp" #else #include "info_generic.cpp" /* Default for unsupported systems.... */ #endif diff --git a/kinfocenter/Modules/base/os_current.h b/kinfocenter/Modules/base/os_current.h index d0e1f644..d62418d7 100644 --- a/kinfocenter/Modules/base/os_current.h +++ b/kinfocenter/Modules/base/os_current.h @@ -46,90 +46,6 @@ bool GetInfo_XServer_and_Video(QTreeWidget* tree); /* i18n("Maybe the proc-filesystem is not enabled in Linux-Kernel.") */ #define DEFAULT_ERRORSTRING QString() - -#elif defined(sgi) && sgi - - #define INFO_IRQ_AVAILABLE - #define INFO_DMA_AVAILABLE - #define INFO_IOPORTS_AVAILABLE - #define INFO_SCSI_AVAILABLE - #define INFO_XSERVER_AVAILABLE - - #define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.") - -#elif defined(__FreeBSD__) || defined(__DragonFly__) - - #define INFO_IRQ_AVAILABLE - #define INFO_DMA_AVAILABLE - #define INFO_IOPORTS_AVAILABLE - #define INFO_SCSI_AVAILABLE - #define INFO_XSERVER_AVAILABLE - - #define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.") - -#elif defined(__hpux) - - #define INFO_IRQ_AVAILABLE - #define INFO_DMA_AVAILABLE - #define INFO_IOPORTS_AVAILABLE - - #define INFO_SCSI_AVAILABLE - - #define INFO_XSERVER_AVAILABLE - - #define DEFAULT_ERRORSTRING QString() - -#elif defined(__NetBSD__) - - #define INFO_IRQ_AVAILABLE - #define INFO_DMA_AVAILABLE - #define INFO_IOPORTS_AVAILABLE - #define INFO_SCSI_AVAILABLE - #define INFO_XSERVER_AVAILABLE - - #define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.") - -#elif defined(__OpenBSD__) - - #define INFO_IRQ_AVAILABLE - #define INFO_DMA_AVAILABLE - #define INFO_IOPORTS_AVAILABLE - #define INFO_SCSI_AVAILABLE - #define INFO_XSERVER_AVAILABLE - - #define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.") - -#elif defined(__svr4__) && defined(sun) - - #define INFO_IRQ_AVAILABLE - #define INFO_DMA_AVAILABLE - #define INFO_IOPORTS_AVAILABLE - #define INFO_SCSI_AVAILABLE - #define INFO_XSERVER_AVAILABLE - - #define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.") - -#elif defined(_AIX) - - #define INFO_SCSI_AVAILABLE - - #define INFO_IRQ_AVAILABLE - #define INFO_DMA_AVAILABLE - #define INFO_IOPORTS_AVAILABLE - #define INFO_XSERVER_AVAILABLE - - #define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.") - -#elif defined(__APPLE__) - - //#define INFO_IRQ_AVAILABLE - //#define INFO_DMA_AVAILABLE - //#define INFO_IOPORTS_AVAILABLE - #define INFO_SCSI_AVAILABLE - #define INFO_XSERVER_AVAILABLE - - #define DEFAULT_ERRORSTRING i18n("This system may not be completely supported yet.") - #else #define INFO_IRQ_AVAILABLE diff --git a/kinfocenter/Modules/memory/base.h b/kinfocenter/Modules/memory/base.h index 0ab1b738..7e7b56bc 100644 --- a/kinfocenter/Modules/memory/base.h +++ b/kinfocenter/Modules/memory/base.h @@ -22,14 +22,12 @@ typedef quint64 t_memsize; enum { /* entries for memoryInfos[] */ TOTAL_MEM = 0, /* total physical memory (without swaps) */ FREE_MEM, /* total free physical memory (without swaps) */ -#if !defined(__svr4__) || !defined(sun) -#if !defined(__NetBSD__) && !defined(__OpenBSD__) +#if !defined(sun) && !defined(__NetBSD__) && !defined(__OpenBSD__) SHARED_MEM, /* shared memory size */ BUFFER_MEM, /* buffered memory size */ #else ACTIVE_MEM, INACTIVE_MEM, -#endif #endif CACHED_MEM, /* cache memory size (located in ram) */ SWAP_MEM, /* total size of all swap-partitions */ diff --git a/kinfocenter/Modules/memory/memory.cpp b/kinfocenter/Modules/memory/memory.cpp index 51107620..513446cd 100644 --- a/kinfocenter/Modules/memory/memory.cpp +++ b/kinfocenter/Modules/memory/memory.cpp @@ -137,8 +137,7 @@ QGroupBox* KCMMemory::initializeText() { case FREE_MEM: title = i18n("Free physical memory:"); break; -#if !defined(__svr4__) || !defined(sun) -#if !defined(__NetBSD__) && !defined(__OpenBSD__) +#if !defined(sun) && !defined(__NetBSD__) && !defined(__OpenBSD__) case SHARED_MEM: title = i18n("Shared memory:"); break; @@ -152,7 +151,6 @@ QGroupBox* KCMMemory::initializeText() { case INACTIVE_MEM: title = i18n("Inactive memory:"); break; -#endif #endif case CACHED_MEM: title = i18n("Disk cache:"); @@ -298,20 +296,12 @@ void KCMMemory::updateMemoryGraphics() { #ifdef __linux__ #include "memory_linux.cpp" -#elif defined(__APPLE__) -#include "memory_osx.cpp" -#elif defined(sgi) && sgi -#include "memory_sgi.cpp" -#elif defined(__svr4__) && defined(sun) +#elif defined(sun) #include "memory_solaris.cpp" #elif defined(__FreeBSD__) || defined(__DragonFly__) #include "memory_fbsd.cpp" -#elif defined(__hpux) -#include "memory_hpux.cpp" #elif defined(__NetBSD__) || defined(__OpenBSD__) #include "memory_netbsd.cpp" -#elif defined(__osf__) -#include "memory_tru64.cpp" #else /* Default for unsupported systems */ diff --git a/kinfocenter/Modules/memory/memory_hpux.cpp b/kinfocenter/Modules/memory/memory_hpux.cpp deleted file mode 100644 index 468a6a57..00000000 --- a/kinfocenter/Modules/memory/memory_hpux.cpp +++ /dev/null @@ -1,95 +0,0 @@ - -/* -Copyright 1999 Helge Deller deller@gmx.de - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of -the License or (at your option) version 3 or any later version -accepted by the membership of KDE e.V. (or its successor approved -by the membership of KDE e.V.), which shall act as a proxy -defined in Section 14 of version 3 of the license. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include - - -#define MAX_SWAP_AREAS 16 - -void KCMMemory::fetchValues() -{ - int page_size,i; - unsigned long total_mem, total_free, - total_physical, total_swap, free_physical, - used_physical, used_swap, free_swap; - - struct pst_static pststatic; - struct pst_dynamic stats; - struct pst_vminfo vmstats; - unsigned long fields_[4]; - struct pst_swapinfo swapinfo; - - pstat_getstatic( &pststatic, sizeof( struct pst_static ), (size_t)1, 0); - total_physical = pststatic.physical_memory; - page_size = (int)pststatic.page_size; - - pstat_getdynamic(&stats, sizeof( pst_dynamic ), (size_t)1, 0); - pstat_getvminfo(&vmstats, sizeof(vmstats), (size_t)1, 0); - - fields_[0] = stats.psd_rmtxt + stats.psd_arm; // TEXT - fields_[1] = stats.psd_rm - stats.psd_rmtxt; // USED - fields_[2] = total_physical - fields_[0] - fields_[1] - stats.psd_free; //OTHER - fields_[3] = stats.psd_free; // FREE - - used_physical = (total_physical - fields_[3]) * page_size; - total_physical *= page_size; - free_physical = (total_physical - used_physical); - - - /* Now check the SWAP-AREAS !! */ - - total_swap = free_swap = 0; - - for (i = 0 ; i < MAX_SWAP_AREAS ; i++) - { - pstat_getswap(&swapinfo, sizeof(swapinfo), (size_t)1, i); - if (swapinfo.pss_idx == (unsigned)i) - { - swapinfo.pss_nfpgs *= 4; // nfpgs is in 512 Byte Blocks.... - if (swapinfo.pss_nblksenabled == 0) // == 0 ?? - swapinfo.pss_nblksenabled = swapinfo.pss_nfpgs; - total_swap += (((unsigned long)swapinfo.pss_nblksenabled) * 1024); - free_swap += (((unsigned long)swapinfo.pss_nfpgs ) * 1024); - } - } - - used_swap = total_swap - free_swap; - - - /* Now display the results */ - - total_mem = total_physical; // + total_swap; - total_free = (total_physical - used_physical);// + free_swap; - - memoryInfos[TOTAL_MEM] = MEMORY(total_mem); // total physical memory (without swaps) - memoryInfos[FREE_MEM] = MEMORY(total_free);// total free physical memory (without swaps) - memoryInfos[SHARED_MEM] = NO_MEMORY_INFO; /* FIXME ?? */ - memoryInfos[BUFFER_MEM] = MEMORY(fields_[2])*page_size; /* FIXME ?? */ - memoryInfos[SWAP_MEM] = MEMORY(total_swap); // total size of all swap-partitions - memoryInfos[FREESWAP_MEM] = MEMORY(free_swap); // free memory in swap-partitions -#ifdef __GNUC__ -#warning "FIXME: memoryInfos[CACHED_MEM]" -#endif - memoryInfos[CACHED_MEM] = NO_MEMORY_INFO; // cached memory in ram -} diff --git a/kinfocenter/Modules/memory/memory_osx.cpp b/kinfocenter/Modules/memory/memory_osx.cpp deleted file mode 100644 index 3f5c5b68..00000000 --- a/kinfocenter/Modules/memory/memory_osx.cpp +++ /dev/null @@ -1,94 +0,0 @@ - -/* - * Copyright (c) 2003 Benjamin Reed - * - * memory_osx.cpp is part of the KDE program kcminfo. Copied wholesale - * from memory_fbsd.cpp =) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void KCMMemory::fetchValues() -{ - - vm_statistics_data_t vm_info; - mach_msg_type_number_t info_count; - DIR *dirp; - struct dirent *dp; - t_memsize total; - - info_count = HOST_VM_INFO_COUNT; - if (host_statistics(mach_host_self (), HOST_VM_INFO, (host_info_t)&vm_info, &info_count)) { - kDebug() << "could not get memory statistics"; - return; - } - - memoryInfos[TOTAL_MEM] = MEMORY(vm_info.active_count + vm_info.inactive_count + - vm_info.free_count + vm_info.wire_count) * vm_page_size; - memoryInfos[FREE_MEM] = MEMORY(vm_info.free_count) * vm_page_size; - memoryInfos[SHARED_MEM] = NO_MEMORY_INFO; - memoryInfos[BUFFER_MEM] = NO_MEMORY_INFO; - memoryInfos[CACHED_MEM] = NO_MEMORY_INFO; - - dirp = opendir("/private/var/vm"); - if (!dirp) { - kDebug() << "unable to open /private/var/vm"; - return; - } - - total = 0; - - while ((dp = readdir (dirp)) != NULL) { - struct stat sb; - char fname [MAXNAMLEN]; - - if (strncmp (dp->d_name, "swapfile", 8)) - continue; - - strcpy (fname, "/private/var/vm/"); - strcat (fname, dp->d_name); - if (stat (fname, &sb) < 0) - continue; - - total += sb.st_size; - } - closedir (dirp); - - info_count = HOST_VM_INFO_COUNT; - if (host_statistics (mach_host_self (), HOST_VM_INFO, - (host_info_t) &vm_info, &info_count)) { - kDebug() << "unable to get VM info"; - } - - memoryInfos[SWAP_MEM] = total; - // off_t used = (vm_info.pageouts - vm_info.pageins) * vm_page_size; - memoryInfos[FREESWAP_MEM] = NO_MEMORY_INFO; - - /* free = MEMORY(vm_info.free_count) * vm_page_size; - used = MEMORY(vm_info.active_count) * vm_page_size; - total = MEMORY(vm_info.active_count + vm_info.inactive_count + - vm_info.free_count + vm_info.wire_count) * vm_page_size; */ - -} diff --git a/kinfocenter/Modules/memory/memory_sgi.cpp b/kinfocenter/Modules/memory/memory_sgi.cpp deleted file mode 100644 index cacd0253..00000000 --- a/kinfocenter/Modules/memory/memory_sgi.cpp +++ /dev/null @@ -1,75 +0,0 @@ - -#include -#include -#include -#include - -// The following define is needed for SGI IRIX 6.2 -#define _KMEMUSER -#include - -#include -#include - -#ifndef UBSIZE -#define UBSIZE 512 -#endif - - -void KCMMemory::fetchValues() -{ - int pagesize = getpagesize(); - - struct rminfo rmi; - if( sysmp(MP_SAGET, MPSA_RMINFO, &rmi, sizeof(rmi)) == -1 ) - return; - memoryInfos[TOTAL_MEM] = MEMORY(rmi.physmem) * pagesize; // total physical memory (without swaps) - memoryInfos[FREE_MEM] = MEMORY(rmi.freemem) * pagesize; // total free physical memory (without swaps) - memoryInfos[BUFFER_MEM] = MEMORY(rmi.bufmem) * pagesize; - - - //FIXME: memoryInfos[CACHED_MEM]" - memoryInfos[CACHED_MEM] = NO_MEMORY_INFO; // cached memory in ram - - long val; - swapctl(SC_GETSWAPTOT, &val); - memoryInfos[SWAP_MEM] = MEMORY(val) * UBSIZE; // total size of all swap-partitions - - swapctl(SC_GETFREESWAP, &val); - memoryInfos[FREESWAP_MEM] = MEMORY(val) * UBSIZE; // free memory in swap-partitions - -#ifndef MPKA_SHMINFO - /* Irix 6.5 (also 6.4?) */ - memoryInfos[SHARED_MEM] = NO_MEMORY_INFO; -#else - FILE *kmem = fopen("/dev/kmem", "r"); - if( kmem == 0 ) { - memoryInfos[SHARED_MEM] = NO_MEMORY_INFO; - return; - } - - long shmip = sysmp(MP_KERNADDR, MPKA_SHMINFO); - fseek( kmem, shmip, 0 ); - struct shminfo shmi; - fread( &shmi, sizeof(shmi), 1, kmem ); - - long shmem = sysmp(MP_KERNADDR, MPKA_SHM); - - val = 0; - long pos; - struct shmid_ds shmid; - for( int i=0 ; i - * - */ - -#include -#include -#include -#include -#include -#include -extern "C" { -#include -} -#include - -#define pagetob(size) (MEMORY(1024L) * ((long) (size) << (long) pageshift)) -#define LOG1024 10 - -extern "C" void vm_statistics(task_t, vm_statistics_data_t*); - -void KCMMemory::fetchValues() -{ - int pageshift; /* log base 2 of the pagesize */ - register int pagesize; - vm_statistics_data_t vmstats; - int swap_pages=0,swap_free=0,i; - struct tbl_swapinfo swbuf; - - /* get the page size with "getpagesize" and calculate pageshift from it */ - - pagesize = getpagesize(); - pageshift = 0; - while (pagesize > 1) { - pageshift++; - pagesize >>= 1; - } - - /* we only need the amount of log(2)1024 for our conversion */ - - pageshift -= LOG1024; - - /* memory information */ - /* this is possibly bogus - we work out total # pages by */ - /* adding up the free, active, inactive, wired down, and */ - /* zero filled. Anyone who knows a better way, TELL ME! */ - /* Change: don't use zero filled. */ - - (void) ::vm_statistics(::task_self(), &vmstats); - - /* thanks DEC for the table() command. No thanks at all for */ - /* omitting the man page for it from OSF/1 1.2, and failing */ - /* to document SWAPINFO in the 1.3 man page. Lets hear it for */ - /* include files. */ - - i=0; - while(table(TBL_SWAPINFO,i,&swbuf,1,sizeof(struct tbl_swapinfo))>0) { - swap_pages += swbuf.size; - swap_free += swbuf.free; - i++; - } - memoryInfos[TOTAL_MEM] = pagetob((vmstats.free_count + - vmstats.active_count + - vmstats.inactive_count + - vmstats.wire_count)); - memoryInfos[FREE_MEM] = pagetob(vmstats.free_count); - memoryInfos[SHARED_MEM] = NO_MEMORY_INFO; /* FIXME ?? */ - memoryInfos[BUFFER_MEM] = NO_MEMORY_INFO; /* FIXME ?? */ -#ifdef __GNUC__ -#warning "FIXME: memoryInfos[CACHED_MEM]" -#endif - memoryInfos[CACHED_MEM] = NO_MEMORY_INFO; /* cached memory in ram */ - memoryInfos[SWAP_MEM] = pagetob(swap_pages); - memoryInfos[FREESWAP_MEM] = pagetob(swap_free); -} diff --git a/kinfocenter/Modules/memory/physicalMemoryChart.cpp b/kinfocenter/Modules/memory/physicalMemoryChart.cpp index 2c11681f..9dbc8c66 100644 --- a/kinfocenter/Modules/memory/physicalMemoryChart.cpp +++ b/kinfocenter/Modules/memory/physicalMemoryChart.cpp @@ -31,10 +31,8 @@ void PhysicalMemoryChart::paintEvent(QPaintEvent* /*event*/) { t_memsize bufferMemory; bufferMemory = 0; -#if !defined(__svr4__) || !defined(sun) -#if !defined(__NetBSD__) && !defined(__OpenBSD__) +#if !defined(sun) && !defined(__NetBSD__) && !defined(__OpenBSD__) bufferMemory = ZERO_IF_NO_INFO(memoryInfos[BUFFER_MEM]); -#endif #endif t_memsize cachedMemory = ZERO_IF_NO_INFO(memoryInfos[CACHED_MEM]); t_memsize freeMemory = ZERO_IF_NO_INFO(memoryInfos[FREE_MEM]); diff --git a/kinfocenter/Modules/nics/nic.cpp b/kinfocenter/Modules/nics/nic.cpp index 4113d672..e483bb76 100644 --- a/kinfocenter/Modules/nics/nic.cpp +++ b/kinfocenter/Modules/nics/nic.cpp @@ -196,10 +196,8 @@ QList findNICs() { tmp->type=i18nc("@item:intext Mode of network card", "Broadcast"); else if ((flags & IFF_POINTOPOINT) == IFF_POINTOPOINT) tmp->type=i18nc("@item:intext Mode of network card", "Point to Point"); -#ifndef _AIX else if ((flags & IFF_MULTICAST) == IFF_MULTICAST) tmp->type=i18nc("@item:intext Mode of network card", "Multicast"); -#endif else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK) tmp->type=i18nc("@item:intext Mode of network card", "Loopback"); else diff --git a/kioslave/fish/fish.cpp b/kioslave/fish/fish.cpp index de3772c1..5b6d769d 100644 --- a/kioslave/fish/fish.cpp +++ b/kioslave/fish/fish.cpp @@ -407,11 +407,7 @@ bool fishProtocol::connectionStart() { #endif int pgrp = getpid(); -#if defined( _AIX) || defined( __hpux) - tcsetpgrp(0, pgrp); -#else ioctl(0, TIOCSPGRP, (char *)&pgrp); -#endif const char *dev = ttyname(0); setpgid(0,0); diff --git a/ksplash/ksplashx/asm_scale.S b/ksplash/ksplashx/asm_scale.S index bec050ad..911fa633 100644 --- a/ksplash/ksplashx/asm_scale.S +++ b/ksplash/ksplashx/asm_scale.S @@ -1,20 +1,9 @@ -#ifdef __EMX__ -/* Due to strange behaviour of as.exe we use this macros */ -/* For all OS/2 coders - please use PGCC to compile this code */ -#define PR_(foo) ___##foo -#define PT_(foo,func) ___##foo,func -#define SIZE(sym) \ - .___end_##sym:; \ - .size ___##sym,.___end_##sym-___##sym; \ - .align 8; -#else #define PR_(foo) __##foo #define PT_(foo,func) __##foo,func #define SIZE(sym) \ .__end_##sym:; \ .size __##sym,.__end_##sym-__##sym; \ .align 8; -#endif /*\ |*| MMX assembly scaling routine for Imlib2 diff --git a/ksplash/ksplashx/defs.h b/ksplash/ksplashx/defs.h index bee3e909..e6bf1b4a 100644 --- a/ksplash/ksplashx/defs.h +++ b/ksplash/ksplashx/defs.h @@ -104,13 +104,8 @@ typedef short Q_INT16; // 16 bit signed typedef unsigned short Q_UINT16; // 16 bit unsigned typedef int Q_INT32; // 32 bit signed typedef unsigned int quint32; // 32 bit unsigned -#if defined(Q_OS_WIN64) -typedef __int64 Q_LONG; // word up to 64 bit signed -typedef unsigned __int64 Q_ULONG; // word up to 64 bit unsigned -#else typedef long Q_LONG; // word up to 64 bit signed typedef unsigned long Q_ULONG; // word up to 64 bit unsigned -#endif #if 0 diff --git a/ksplash/ksplashx/qimage.cpp b/ksplash/ksplashx/qimage.cpp index f3993f5a..37604374 100644 --- a/ksplash/ksplashx/qimage.cpp +++ b/ksplash/ksplashx/qimage.cpp @@ -1105,12 +1105,6 @@ QImage::Endian QImage::systemByteOrder() #include // needed for systemBitOrder #include #include -#if defined(Q_OS_WIN32) -#undef open -#undef close -#undef read -#undef write -#endif #endif // POSIX Large File Support redefines open -> open64 diff --git a/ksplash/ksplashx/qjpegio.cpp b/ksplash/ksplashx/qjpegio.cpp index 1194f486..3e9576ce 100644 --- a/ksplash/ksplashx/qjpegio.cpp +++ b/ksplash/ksplashx/qjpegio.cpp @@ -65,9 +65,6 @@ // including jpeglib.h seems to be a little messy extern "C" { #define XMD_H // shut JPEGlib up -#if defined(Q_OS_UNIXWARE) -# define HAVE_BOOLEAN // libjpeg under Unixware seems to need this -#endif #include #ifdef const # undef const // remove crazy C hackery in jconfig.h @@ -127,18 +124,14 @@ boolean qt_fill_input_buffer(j_decompress_ptr cinfo) num_read = fread( (char*)src->buffer, 1, max_buf, src->f ); if ( num_read <= 0 ) { - // Insert a fake EOI marker - as per jpeglib recommendation - src->buffer[0] = (JOCTET) 0xFF; - src->buffer[1] = (JOCTET) JPEG_EOI; - src->bytes_in_buffer = 2; + // Insert a fake EOI marker - as per jpeglib recommendation + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + src->bytes_in_buffer = 2; } else { - src->bytes_in_buffer = num_read; + src->bytes_in_buffer = num_read; } -#if defined(Q_OS_UNIXWARE) - return B_TRUE; -#else return TRUE; -#endif } static @@ -153,15 +146,15 @@ void qt_skip_input_data(j_decompress_ptr cinfo, long num_bytes) * any trouble anyway --- large skips are infrequent. */ if (num_bytes > 0) { - while (num_bytes > (long) src->bytes_in_buffer) { - num_bytes -= (long) src->bytes_in_buffer; - (void) qt_fill_input_buffer(cinfo); - /* note we assume that qt_fill_input_buffer will never return FALSE, - * so suspension need not be handled. - */ - } - src->next_input_byte += (size_t) num_bytes; - src->bytes_in_buffer -= (size_t) num_bytes; + while (num_bytes > (long) src->bytes_in_buffer) { + num_bytes -= (long) src->bytes_in_buffer; + (void) qt_fill_input_buffer(cinfo); + /* note we assume that qt_fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->next_input_byte += (size_t) num_bytes; + src->bytes_in_buffer -= (size_t) num_bytes; } } @@ -205,13 +198,9 @@ QImage splash_read_jpeg_image(FILE* f) jerr.error_exit = my_error_exit; if (!setjmp(jerr.setjmp_buffer)) { -#if defined(Q_OS_UNIXWARE) - (void) jpeg_read_header(&cinfo, B_TRUE); -#else - (void) jpeg_read_header(&cinfo, TRUE); -#endif + (void) jpeg_read_header(&cinfo, TRUE); - (void) jpeg_start_decompress(&cinfo); + (void) jpeg_start_decompress(&cinfo); { bool created = FALSE;