Changeset 2596 for neercs/trunk


Ignore:
Timestamp:
Jul 27, 2008, 9:08:41 PM (12 years ago)
Author:
Pascal Terjan
Message:
  • Suffix the server socket, it's on them that we glob
  • If the last socket does not work, try the previous ones
Location:
neercs/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/attach.c

    r2592 r2596  
    2929        dir = "/tmp";
    3030    if(path)
    31         snprintf(path, PATH_MAX+1, "%s/neercs.%s%s.sock", dir, session_name, client?"-clt":"");
     31        snprintf(path, PATH_MAX+1, "%s/neercs.%s%s.sock", dir, session_name, client?"":".srv");
    3232    return path;
    3333}
     
    128128
    129129    if(session_name && strlen(session_name)+strlen(dir)+13<PATH_MAX)
    130         sprintf(pattern, "%s/neercs.%s.sock", dir, session_name);
     130        sprintf(pattern, "%s/neercs.%s.srv.sock", dir, session_name);
    131131    else
    132         snprintf(pattern, PATH_MAX, "%s/neercs.*.sock", dir);
     132        snprintf(pattern, PATH_MAX, "%s/neercs.*.srv.sock", dir);
    133133    pattern[PATH_MAX] = '\0';
    134134
  • neercs/trunk/src/main.c

    r2595 r2596  
    263263            screen_list->s_socket_path = strdup(sockets[i]);
    264264            session = connect_server(screen_list);
     265            while(!session && i > 0)
     266            {
     267                free(screen_list->s_socket_path);
     268                i--;
     269                screen_list->s_socket_path = strdup(sockets[i]);
     270                session = connect_server(screen_list);
     271            }
    265272            debug("Connected to session %s", session);
    266273            if(session)
Note: See TracChangeset for help on using the changeset viewer.