Update of /cvsroot/tmux/tmux
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv5768

Modified Files:
        tmux.1 tmux.c 
Log Message:
Sync OpenBSD patchset 838:

Use TMPDIR if set, from Han Boetes.


Index: tmux.c
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.c,v
retrieving revision 1.234
retrieving revision 1.235
diff -u -d -r1.234 -r1.235
--- tmux.c      21 Jan 2011 23:44:13 -0000      1.234
+++ tmux.c      21 Jan 2011 23:46:50 -0000      1.235
@@ -172,12 +172,15 @@
 char *
 makesocketpath(const char *label)
 {
-       char            base[MAXPATHLEN], *path;
+       char            base[MAXPATHLEN], *path, *s;
        struct stat     sb;
        u_int           uid;
 
        uid = getuid();
-       xsnprintf(base, MAXPATHLEN, "%s/tmux-%d", _PATH_TMP, uid);
+       if ((s = getenv("TMPDIR")) == NULL || *s == '\0')
+               xsnprintf(base, sizeof base, "%s/tmux-%u", _PATH_TMP, uid);
+       else
+               xsnprintf(base, sizeof base, "%s/tmux-%u", s, uid);
 
        if (mkdir(base, S_IRWXU) != 0 && errno != EEXIST)
                return (NULL);

Index: tmux.1
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.1,v
retrieving revision 1.292
retrieving revision 1.293
diff -u -d -r1.292 -r1.293
--- tmux.1      21 Jan 2011 23:45:34 -0000      1.292
+++ tmux.1      21 Jan 2011 23:46:50 -0000      1.293
@@ -134,7 +134,10 @@
 .It Fl L Ar socket-name
 .Nm
 stores the server socket in a directory under
-.Pa /tmp ;
+.Pa /tmp
+(or
+.Ev TMPDIR
+if set);
 the default socket is named
 .Em default .
 This option allows a different socket name to be specified, allowing several


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to