@@ -134,7 +134,7 @@ static char DefaultShell[] = "/bin/sh";
134134static char DefaultPath [] = ":/bin:/usr/bin" ;
135135static int TtyMode = 0622 ;
136136static char SockPath [PATH_MAX ];
137- static char SockDir [] = "screen " ;
137+ static char SockDir [] = "scr " ;
138138static char * SockNamePtr , * SockName ;
139139static int ServerSocket ;
140140static char * NewEnv [MAXARGS ];
@@ -313,7 +313,7 @@ main(int ac, char **av)
313313 if ((home = getenv ("HOME" )) == 0 )
314314 Msg (0 , "$HOME is undefined." );
315315
316- sprintf (SockPath , "%s/%s" , home , SockDir ); /* SockDir = "screen " */
316+ sprintf (SockPath , "%s/%s" , home , SockDir ); /* SockDir = "scr " */
317317 if (stat (SockPath , & st ) == -1 ) {
318318 if (errno == ENOENT ) {
319319 if (mkdir (SockPath , 0700 ) == -1 )
@@ -1392,14 +1392,14 @@ MakeServerSocket(void)
13921392 a .sun_family = AF_UNIX ;
13931393 strcpy (SockNamePtr , SockName );
13941394 strcpy (a .sun_path , SockPath );
1395- if (connect (s , (struct sockaddr * )& a , strlen (SockPath ) + 2 ) != -1 ) {
1395+ if (connect (s , (struct sockaddr * )& a , strlen (SockPath ) + 1 ) != -1 ) {
13961396 p = Filename (SockPath );
13971397 Msg (0 , "You have already a screen running on %s.\n\
13981398If it has been detached, try \"screen -r\"." , p );
13991399 /* NOTREACHED */
14001400 }
14011401 unlink (SockPath );
1402- if (bind (s , (struct sockaddr * )& a , strlen (SockPath ) + 2 ) == -1 )
1402+ if (bind (s , (struct sockaddr * )& a , strlen (SockPath ) + 1 ) == -1 )
14031403 Msg (errno , "bind" );
14041404 chown (SockPath , getuid (), getgid ());
14051405 if (listen (s , 5 ) == -1 )
@@ -1418,7 +1418,7 @@ MakeClientSocket(int err)
14181418 a .sun_family = AF_UNIX ;
14191419 strcpy (SockNamePtr , SockName );
14201420 strcpy (a .sun_path , SockPath );
1421- if (connect (s , (struct sockaddr * )& a , strlen (SockPath ) + 2 ) == -1 ) {
1421+ if (connect (s , (struct sockaddr * )& a , strlen (SockPath ) + 1 ) == -1 ) {
14221422 if (err ) {
14231423 Msg (errno , "connect: %s" , SockPath );
14241424 } else {
0 commit comments