From: Harlan Stenn Date: Wed, 4 Mar 2015 11:16:31 +0000 (+0000) Subject: [Bug 2775] ntp-keygen.c fails to compile under Windows X-Git-Tag: NTP_4_3_4~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30ad2ea1f1557f48ffdeb18c8f1fbe081512e62a;p=thirdparty%2Fntp.git [Bug 2775] ntp-keygen.c fails to compile under Windows bk: 54f6e98fstR2EjPfP7lqxp__eCm1mQ --- diff --git a/ChangeLog b/ChangeLog index 453620ee5..18b025751 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ * [Bug 2767] ntp-keygen -M should symlink to ntp.keys. * [Bug 2771] nonvolatile value is documented in wrong units. * [Bug 2773] Early leap announcement from Palisade/Thunderbolt +* [Bug 2775] ntp-keygen.c fails to compile under Windows. --- (4.2.8p1) 2015/02/04 Released by Harlan Stenn diff --git a/util/ntp-keygen.c b/util/ntp-keygen.c index a4ebfe031..853b49434 100644 --- a/util/ntp-keygen.c +++ b/util/ntp-keygen.c @@ -2170,13 +2170,19 @@ fheader ( FILE *str; /* file handle */ char linkname[MAXFILENAME]; /* link name */ int temp; +#ifdef HAVE_UMASK mode_t orig_umask; - +#endif + snprintf(filename, sizeof(filename), "ntpkey_%s_%s.%u", file, owner, fstamp); +#ifdef HAVE_UMASK orig_umask = umask( S_IWGRP | S_IRWXO ); str = fopen(filename, "w"); (void) umask(orig_umask); +#else + str = fopen(filename, "w"); +#endif if (str == NULL) { perror("Write"); exit (-1);