[Y-devel] Some patches for Re: Compile Problems on BSD
JP Dinger jpd at dsb.tudelft.nl
Sun Feb 22 00:34:46 GMT 2004
On Sat, Feb 21, 2004 at 03:24:33PM -0600, Augie Fackler wrote:
> On Saturday, February 21, 2004, at 01:07 PM, JP Dinger wrote:
[snip: FreeBSD patches]
> I hear ya , but we need to test the patches first. Once we get
> something working, we can submit it.
> I just updated my i386 laptop to 5.2.1-rc2, so I will have most of the
> C99 stuff. Are you still on 4.x?
Yep, 4.9R-p2 currently.
> Your patches will be available shortly at
> https://tuxserver.ath.cx/~durin/Y/
I'll check. :-)
> I'm going to start in on libiterm, to see if I can get yiterm working
> soon.
I've just dug up an old patch that I wrote in the night Y-0.1 got /.ed.
(Can you tell?) I guess probably it's still relevant. But altough it
compiled I never got it yiterm to properly work.
You probably want to add the proper FreeBSD support or use a posix or
SUS compatible construct. Or both, and let the auto*-tools sort out
the difference. <runs awaaaay/>
***
--- iterm-0.5-mbt/lib/src/unix/tty/ttyio.c.orig Sun Sep 28 18:05:58 2003
+++ iterm-0.5-mbt/lib/src/unix/tty/ttyio.c Sun Sep 28 19:56:33 2003
@@ -21,13 +21,19 @@
#include <stdlib.h>
#undef __USE_XOPEN
#include <unistd.h>
+#ifdef USE_STREAMS
#include <stropts.h>
+#else
+#include <sys/file.h>
+#endif
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <errno.h>
+#ifdef TEHLINEX
#include <utmpx.h>
+#endif
#include <pwd.h>
#if defined(HAVE_LIBUTEMPTER)
@@ -50,6 +56,7 @@
/* flag if this file descriptor is closed or not */
};
+#ifdef TEHLINEX
#if defined(HAVE_LIBUTEMPTER)
#define write_utmp(tty_name,fd) addToUtmp(tty_name,NULL,fd);
#define delete_utmp(tty_name) removeFromUtmp();
@@ -138,7 +145,15 @@
endutxent();
}
#endif
+#else
+/* just fscking ignore utmp alltogether. I don't feel like doing anything
+ fancy like adding freebsd login(3) and logout(3) support.
+ */
+#define write_utmp(dummy) ;
+#define delete_utmp(dummy) ;
+#endif
+#ifdef USE_STREAMS /* this looks like it's stolen from UNP */
static int open_master(char *slave_name)
{
char *ptys;
@@ -206,6 +221,37 @@
return fd;
}
+#else /* let's copy something different from UNP instead, then */
+/* thanks, stevens */
+static int open_master(char *slave_name) {
+ int i, master_fd;
+ char *ptr;
+ struct stat statbuff;
+ static char ptychar[] = "pqrs"; /* X */
+ static char hexdigit[] = "0123456789abcdef"; /* Y */
+ for(ptr=ptychar; *ptr != 0; ++ptr) {
+ strcpy(slave_name, "/dev/ptyXY");
+ slave_name[8] = *ptr; /* X */
+ slave_name[9] = '0'; /* Y */
+ if(stat(slave_name,&statbuff)<0) break;
+ for(i=0;i<16;++i) {
+ slave_name[9] = hexdigit[i];
+ if((master_fd=open(slave_name, O_RDWR))>=0)
+ return(master_fd);
+ }
+ }
+ return -1;
+}
+int open_slave(int master_fd,char *slave_name) {
+ int slave_fd;
+ slave_name[5] = 't';
+ if((slave_fd=open(slave_name,O_RDWR))<0) {
+ close(master_fd);
+ return -1;
+ }
+ return slave_fd;
+}
+#endif
static int get_slave_fd(int master_fd, char *slave_name)
{
int fd;
***
The UNP comments are mostly interesting because what is in the original
and what I added sit right next to each other in the book as well.
[snip: hilite && Stuff]
>
> Sure thing
Thanks.
--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved