Changeset 2481 for neercs/trunk


Ignore:
Timestamp:
Jun 23, 2008, 11:59:43 PM (12 years ago)
Author:
Pascal Terjan
Message:
  • Improve the speed of current attach (even if it will die)
  • Fix some messages
Location:
neercs/trunk/src
Files:
3 edited

Legend:

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

    r2476 r2481  
    7979    close(2);
    8080
     81    fd = open("/dev/null", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
     82    dup2(fd, 0);
     83    if(fd != 0)
     84        close(fd);
    8185    fd = open("/tmp/log.txt", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
    82     dup2(fd, 0);
    8386    dup2(fd, 1);
    8487    dup2(fd, 2);
     
    195198int request_attach(char *socket_path)
    196199{
    197     int i;
    198200    int sock;
    199201    char fdstr[PATH_MAX], lnk[PATH_MAX];
     
    214216    if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0)
    215217    {
    216         perror("request_attach:connect");
     218        printf("Failed to connect to %s: %s\n", socket_path, strerror(errno));
    217219        return 1;
    218220    }
     
    221223
    222224    /* Send our environment */
    223     for(i=0; environ[i]; i++)
    224     {
    225         snprintf(buf, 4096, "ENV %s", environ[i]);
    226         write(sock, buf, strlen(buf));
    227     }
     225#define sendvar(var) if(getenv(var)) {snprintf(buf, 4096, "ENV %s=%s", var, getenv(var)); write(sock, buf, strlen(buf));}
     226    sendvar("DISPLAY")
     227    sendvar("CACA_DRIVER")
    228228
    229229    snprintf(fdstr, sizeof(fdstr), "/proc/%d/fd/0", getpid());
  • neercs/trunk/src/configuration.c

    r2474 r2481  
    266266            else if(IS_VALUE("card"))   screen_list->wm_type = WM_CARD;
    267267
    268             else fprintf(stderr, "Unknow window manager '%s'\n", option->key);
     268            else fprintf(stderr, "Unknown window manager '%s'\n", option->key);
    269269
    270270        } else if(IS_TOKEN("thumbnails"))
  • neercs/trunk/src/main.c

    r2480 r2481  
    222222        if(nb_to_grab || (argc-1 > s))
    223223        {
    224             fprintf(stderr, "-R can be associated with commands or pids!\n");
     224            fprintf(stderr, "-R can not be associated with commands or pids!\n");
    225225            return -1;
    226226        }
Note: See TracChangeset for help on using the changeset viewer.