sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: rsalz@osf.org
To: sam-fans@hawkwind.utcs.toronto.edu
Subject: Naming the pipe
Date: Tue, 13 Apr 1993 10:39:02 -0400	[thread overview]
Message-ID: <9304131439.AA04387@earth.osf.org> (raw)

I think the following patch to samterm/unix.c is a good idea.
It allows the environment variable $sampipe, if set, to specify
the name of the fifo.
*** unix.c.save	Tue Apr 13 10:31:46 1993
--- unix.c	Tue Apr 13 10:33:25 1993
***************
*** 70,84 ****
  	int	fd;
  	int	flags;
  
! 	user = getuser();
! 	disp = getenv("DISPLAY");
  
! 	if (disp) {
! 		exname = (char *)alloc(4 + 6 + strlen(user) + 1 + strlen(disp) + 1);
! 		sprint(exname, "/tmp/.sam.%s.%s", user, disp);
! 	} else { 
! 		exname = (char *)alloc(4 + 6 + strlen(user) + 1);
! 		sprint(exname, "/tmp/.sam.%s", user);
  	}
  
  	/* Make the named pipe.  Multiple sams with the same user/display share the same pipe */
--- 70,90 ----
  	int	fd;
  	int	flags;
  
! 	disp = getenv("sampipe");
! 	if (disp == 0) {
! 		user = getuser();
! 		disp = getenv("DISPLAY");
  
! 		if (disp) {
! 			exname = (char *)alloc(4 + 6 + strlen(user) + 1 + strlen(disp) + 1);
! 			sprint(exname, "/tmp/.sam.%s.%s", user, disp);
! 		} else { 
! 			exname = (char *)alloc(4 + 6 + strlen(user) + 1);
! 			sprint(exname, "/tmp/.sam.%s", user);
! 		}
! 	} else {
! 		exname = (char *)alloc(strlen(disp) + 1);
! 		strcpy(exname, disp);
  	}
  
  	/* Make the named pipe.  Multiple sams with the same user/display share the same pipe */


                 reply	other threads:[~1993-04-13 14:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9304131439.AA04387@earth.osf.org \
    --to=rsalz@osf.org \
    --cc=sam-fans@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).