Skip to content

Commit

Permalink
Prefer UNIX_PATH_MAX over UNIX_PATH_LEN
Browse files Browse the repository at this point in the history
Cygwin used to define UNIX_PATH_LEN, but in cygwin-1_7_18-release and
cygwin-64bit-branch, sys/un.h renamed to MAX to follow Linux. (CVS r1.7)

This commit will be pushed using 64-bit ssh-pageant, proving that all is
well here for cygwin64.  For the adventurous, it also does work to let
cygwin64 processes talk to cygwin32 ssh-pageant, and vice versa, as long
as you reconcile their different filesystem mounts in SSH_AUTH_SOCK.
  • Loading branch information
cuviper committed Mar 23, 2013
1 parent 02d6e55 commit 36ff2ec
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
#include "winpgntc.h"


// Cygwin now has UNIX_PATH_MAX, but used to be _LEN
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX UNIX_PATH_LEN
#endif


#define FD_FOREACH(fd, set) \
for (fd = 0; fd < FD_SETSIZE; ++fd) \
if (FD_ISSET(fd, set))
Expand All @@ -39,8 +45,8 @@ struct fd_buf {
};


static char cleanup_tempdir[UNIX_PATH_LEN] = "";
static char cleanup_sockpath[UNIX_PATH_LEN] = "";
static char cleanup_tempdir[UNIX_PATH_MAX] = "";
static char cleanup_sockpath[UNIX_PATH_MAX] = "";


static void cleanup_exit(int status) __attribute__((noreturn));
Expand Down Expand Up @@ -292,7 +298,7 @@ do_agent_loop(int sockfd)
int
main(int argc, char *argv[])
{
char sockpath[UNIX_PATH_LEN] = "";
char sockpath[UNIX_PATH_MAX] = "";
static struct option long_options[] = {
{ "help", no_argument, 0, 'h' },
{ "version", no_argument, 0, 'v' },
Expand Down

0 comments on commit 36ff2ec

Please sign in to comment.