Changeset 1945

Show
Ignore:
Timestamp:
08/18/2007 09:46:07 AM (14 months ago)
Author:
jan
Message:

use sizeof(sun_path) instead of guessing UNIX_PATH_MAX (fixes #713)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/spawn-fcgi.c

    r1916 r1945  
    3131 
    3232#define FCGI_LISTENSOCK_FILENO 0 
    33  
    34 #ifndef UNIX_PATH_MAX 
    35 # define UNIX_PATH_MAX 108 
    36 #endif 
    37  
    3833 
    3934#ifdef HAVE_SYS_WAIT_H 
     
    302297        int pid_fd = -1; 
    303298        int nofork = 0; 
     299        struct sockaddr_un un; 
    304300 
    305301        i_am_root = (getuid() == 0); 
     
    339335        } 
    340336 
    341         if (unixsocket && strlen(unixsocket) > UNIX_PATH_MAX - 1) { 
     337        if (unixsocket && strlen(unixsocket) > sizeof(un.sun_path) - 1) { 
    342338                fprintf(stderr, "%s.%d: %s\n", 
    343339                        __FILE__, __LINE__,