Skip to content

Commit

Permalink
build-info: add Cygwin version information
Browse files Browse the repository at this point in the history
The recent version of Cygwin removed support for many old Windows
versions/platforms. Adding this information to the output can help
us detect if end users are complaining about unsupported things.

Signed-off-by: Claudio André <dev@claudioandre.slmail.me>
  • Loading branch information
claudioandre-br committed Mar 31, 2024
1 parent 3c2e19c commit 301ee7f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/listconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ extern char CPU_req_name[];

#define SINGLE_MAX_WORDS(len) MIN(SINGLE_IDX_MAX, SINGLE_BUF_MAX / len + 1)

#if defined (__CYGWIN__)
#include <sys/utsname.h>
#endif

/*
* FIXME: Should all the listconf_list_*() functions get an additional stream
* parameter, so that they can write to stderr instead of stdout in case fo an
Expand Down Expand Up @@ -345,6 +349,18 @@ static void listconf_list_build_info(void)
printf("Terminal locale string: %s\n", john_terminal_locale);
printf("Parsed terminal locale: %s\n", cp_id2name(options.terminal_enc));

#if defined (__CYGWIN__)
{
struct utsname buffer;

errno = 0;
if (uname(&buffer) < 0)
printf("Cygwin version detection error\n");
else
printf("Cygwin version: %s, %s\n", buffer.release, buffer.version);
}
#endif

// OK, now append debugging options, BUT only output something if
// one or more of them is set. IF none set, be silent.
#if defined (DEBUG)
Expand Down

0 comments on commit 301ee7f

Please sign in to comment.