[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: KDE_1_1_BRANCH: Franz Sir'l's kvt bugfix patch works - lets
From: Duncan Haldane <f.d.m.haldane () mciworld ! com>
Date: 2001-02-04 19:39:34
[Download RAW message or body]
This message is in MIME format
On 02-Aug-99 Cristian Tibirna wrote:
>
> On Sun, 1 Aug 1999, Duncan Haldane wrote:
>
>> *** Can I add it to the CVS now ? (for the kde-1.1.2 release ?) *****
>> (Does Franz + me make the required two-person stamp of approval ?),
>> I have cvs acces and will add it if nobody objects .....
>
> OK. If you're still unsure, you can post the patch here (if not too big)
> or send it to me for third review. If you're certain all's OK, just apply
> it.
OK here is the kvt patch from Franz Sirl, now remade against the current CVS KDE_1_1_BRANCH.
I verified that it works (on RedHat 6.1). Its a fix for glibc-2.1 systems.
Can Cristian or someone else give another OK,
This needs to go in the KDE_1_1_ Branch for the 1.1.2 release ASAP.
Thanks
Duncan.
----------------------------------
E-Mail: Duncan Haldane <f.d.m.haldane@mciworld.com>
Date: 03-Aug-99
Time: 03:31:38
This message was sent by XFMail
----------------------------------
["kdebase-kvtfix.patch" (kdebase-kvtfix.patch)]
diff -uNr kdebase/kvt/command.c kdebase-kvtfix/kvt/command.c
--- kdebase/kvt/command.c Wed Jul 28 04:52:31 1999
+++ kdebase-kvtfix/kvt/command.c Tue Aug 3 03:28:21 1999
@@ -24,6 +24,9 @@
* aggreed to distribute their code under the terms of the GPL
*/
+/* define _GNU_SOURCE to get prototypes for getpt() and ptsname() */
+#define _GNU_SOURCE
+
#include <stdarg.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -41,7 +44,7 @@
#include "debug.h"
#if defined (_HPUX_SOURCE)
-/* #define _TERMIOS_INCLUDED */
+#define _TERMIOS_INCLUDED
#include <bsdtty.h>
#endif
/* sgis have /dev/ptmx [bmg] */
@@ -96,10 +99,6 @@
#include "screen.h"
#include "xsetup.h"
-#if !defined(HAVE_SETEUID)
-#define seteuid(_eu) setresuid(-1, _eu, -1)
-#endif
-
#if defined(VDISCRD) && !defined(VDISCARD)
#define VDISCARD VDISCRD
#endif
@@ -171,12 +170,16 @@
static int fd_width; /* width of file descriptors being used */
static int app_cur_keys = 0;/* flag to set cursor keys in application mode */
static int app_kp_keys = 0; /* flag to set application keypad keys */
+#if __GLIBC__ - 0 == 2 && __GLIBC_MINOR__ >= 1
+char *ttynam;
+#else
#ifndef SVR4
static char ptynam[25] = "/dev/ptyxx";
char ttynam[25] = "/dev/ttyxx";
#else
char *ttynam, *ptsname();
#endif
+#endif
static Atom wm_del_win;
extern WindowInfo MyWinInfo;
@@ -352,6 +355,29 @@
/* First find a master pty that we can open.
*/
+#if __GLIBC__ - 0 == 2 && __GLIBC_MINOR__ >= 1
+ ptyfd = getpt();
+ if (ptyfd < 0)
+ {
+ error("Can't open a pseudo teletype");
+ return(-1);
+ }
+ if (grantpt(ptyfd) < 0 || unlockpt(ptyfd) < 0)
+ {
+ close(ptyfd);
+ error("Can't grantpt/unlockpt a pseudo teletype");
+ return(-1);
+ }
+ ttynam = ptsname(ptyfd);
+ if (ttynam == 0)
+ {
+ close(ptyfd);
+ error("Pseudo teletype has no name");
+ return(-1);
+ }
+ fcntl(ptyfd,F_SETFL,O_NDELAY);
+ grantpty = 0;
+#else
#ifdef TIOCGPTN
strcpy(ptynam,"/dev/ptmx");
strcpy(ttynam,"/dev/pts/");
@@ -422,6 +448,7 @@
fcntl(ptyfd,F_SETFL,O_NDELAY);
#endif
}
+#endif /* GLIBC */
for (i = 1; i <= 15; i++)
signal(i,catch_sig);
diff -uNr kdebase/kvt/main.C kdebase-kvtfix/kvt/main.C
--- kdebase/kvt/main.C Wed Jul 28 04:52:32 1999
+++ kdebase-kvtfix/kvt/main.C Tue Aug 3 03:28:21 1999
@@ -46,10 +46,6 @@
#include "main.h"
-#if !defined(HAVE_SETEUID)
-#define seteuid(_eu) setresuid(-1, _eu, -1)
-#endif
-
extern "C" {
extern void *safemalloc(int, const char *identifier);
extern void get_token();
diff -uNr kdebase/kvt/utmp.c kdebase-kvtfix/kvt/utmp.c
--- kdebase/kvt/utmp.c Wed Jul 28 04:52:34 1999
+++ kdebase-kvtfix/kvt/utmp.c Tue Aug 3 03:28:21 1999
@@ -1,4 +1,4 @@
-/* $Id: utmp.c,v 1.7.4.4 1999/07/28 08:52:34 porten Exp $
+/* $Id: utmp.c,v 1.7.4.3 1999/06/08 09:09:22 hoelzer Exp $
*
* Revision 1.5 08/09/1993 stempien
* Something was wrong with the Linux support!
@@ -8,9 +8,6 @@
* I didn't touch the Sun part of the code so it should still work.
*
* $Log: utmp.c,v $
- * Revision 1.7.4.4 1999/07/28 08:52:34 porten
- * HP-UX fixes from Stefan.Becker@nmp.nokia.com
- *
* Revision 1.7.4.3 1999/06/08 09:09:22 hoelzer
* Fixed several security holes.
*
@@ -96,10 +93,6 @@
#include <stdio.h>
#include <memory.h>
-#if !defined(HAVE_SETEUID)
-#define seteuid(_eu) setresuid(-1, _eu, -1)
-#endif
-
#ifndef TTYTAB
#define TTYTAB "/etc/ttys"
#endif
@@ -316,6 +309,7 @@
setutent();
pututline(u);
endutent();
+ updwtmp(WTMP_FILE, u);
pos = (int)NULL;
madeutent = 1;
@@ -411,6 +405,7 @@
#endif
pututline(u); /* Was reversed with in the original */
endutent();
+ updwtmp(WTMP_FILE, u);
}
}
End of MIME message
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic