[krbdev.mit.edu #1431] patch to compile with cygwin
The RT System itself via RT
rt-comment at krbdev.mit.edu
Sat Apr 19 02:40:29 EDT 2003
>From liebman at gateway.la.zod.com Sat Apr 19 02:40:23 2003
Received: from fort-point-station.mit.edu (FORT-POINT-STATION.MIT.EDU [18.7.7.76]) by krbdev.mit.edu (8.9.3) with ESMTP
id CAA10861; Sat, 19 Apr 2003 02:40:23 -0400 (EDT)
Received: from gateway.la.zod.com (66-215-26-54.pas-mres.charterpipeline.net [66.215.26.54])
by fort-point-station.mit.edu (8.12.4/8.9.2) with ESMTP id h3J6eMfB023572
for <krb5-bugs at mit.edu>; Sat, 19 Apr 2003 02:40:22 -0400 (EDT)
Received: from gateway.la.zod.com (gateway.la.zod.com [127.0.0.1])
by gateway.la.zod.com (8.12.8/8.12.8) with ESMTP id h3J6eL8F013178
for <krb5-bugs at mit.edu>; Fri, 18 Apr 2003 23:40:21 -0700
Received: (from liebman at localhost)
by gateway.la.zod.com (8.12.8/8.12.8/Submit) id h3J6eL7P013176
for krb5-bugs at mit.edu; Fri, 18 Apr 2003 23:40:21 -0700
Date: Fri, 18 Apr 2003 23:40:21 -0700
From: "Christopher B. Liebman" <liebman at gateway.la.zod.com>
Message-Id: <200304190640.h3J6eL7P013176 at gateway.la.zod.com>
To: krb5-bugs at mit.edu
Subject: patch for cygwin
To: krb5-bugs at mit.edu
Subject:
From: liebman
Reply-To: liebman
Cc:
X-send-pr-version: 3.99
>Submitter-Id: net
>Originator: Christopher B. Liebman
>Organization:
None
>Confidential: no
>Synopsis: patch to compile with cygwin
>Severity: non-critical
>Priority: low
>Category: krb5-misc
>Class: sw-bug
>Release: krb5-1.2.8
>Environment:
System: CYGWIN_NT-5.0 XYZZY 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown Cygwin
>Description:
some compile problems relating to the definition of errno and
issues renaming files that are open
>How-To-Repeat:
compile on Windows under cygwin
>Fix:
diff -u -r krb5-1.2.8-dist/src/lib/krb4/in_tkt.c krb5-1.2.8/src/lib/krb4/in_tkt.c
--- krb5-1.2.8-dist/src/lib/krb4/in_tkt.c 2001-01-26 20:43:32.000000000 -0800
+++ krb5-1.2.8/src/lib/krb4/in_tkt.c 2003-04-18 21:45:36.000000000 -0700
@@ -35,6 +35,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
extern int krb_debug;
diff -u -r krb5-1.2.8-dist/src/lib/krb4/send_to_kdc.c krb5-1.2.8/src/lib/krb4/send_to_kdc.c
--- krb5-1.2.8-dist/src/lib/krb4/send_to_kdc.c 2000-05-17 00:13:44.000000000 -0700
+++ krb5-1.2.8/src/lib/krb4/send_to_kdc.c 2003-04-18 21:15:46.000000000 -0700
@@ -18,7 +18,9 @@
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
-
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
#define S_AD_SZ sizeof(struct sockaddr_in)
#ifdef HAVE_STDLIB_H
diff -u -r krb5-1.2.8-dist/src/lib/krb5/rcache/rc_io.c krb5-1.2.8/src/lib/krb5/rcache/rc_io.c
--- krb5-1.2.8-dist/src/lib/krb5/rcache/rc_io.c 2001-10-29 17:21:32.000000000 -0800
+++ krb5-1.2.8/src/lib/krb5/rcache/rc_io.c 2003-04-18 21:15:46.000000000 -0700
@@ -262,6 +262,18 @@
krb5_rc_io_open(context, new, fn);
free(fn);
#else
+#ifdef __CYGWIN__
+ close(new->fd);
+/* unlink(new->fn);*/
+ close(old->fd);
+ if (rename(old->fn,new->fn) == -1) /* MUST be atomic! */
+ return KRB5_RC_IO_UNKNOWN;
+ fn = new->fn;
+ new->fn = NULL; /* avoid clobbering */
+ krb5_rc_io_close(context, new);
+ krb5_rc_io_open(context, new, fn);
+ free(fn);
+#else
if (rename(old->fn,new->fn) == -1) /* MUST be atomic! */
return KRB5_RC_IO_UNKNOWN;
fn = new->fn;
@@ -274,6 +286,7 @@
new->fd = dup(old->fd);
#endif
#endif
+#endif
return 0;
}
diff -u -r krb5-1.2.8-dist/src/util/ss/help.c krb5-1.2.8/src/util/ss/help.c
--- krb5-1.2.8-dist/src/util/ss/help.c 2000-05-01 08:53:38.000000000 -0700
+++ krb5-1.2.8/src/util/ss/help.c 2003-04-18 21:40:16.000000000 -0700
@@ -12,7 +12,11 @@
#include "ss_internal.h"
#include "copyright.h"
+#ifdef __CYGWIN__
+#include <errno.h>
+#else
extern int errno;
+#endif
void ss_help (argc, argv, sci_idx, info_ptr)
int argc;
diff -u -r krb5-1.2.8-dist/src/util/ss/pager.c krb5-1.2.8/src/util/ss/pager.c
--- krb5-1.2.8-dist/src/util/ss/pager.c 1995-04-27 09:41:16.000000000 -0700
+++ krb5-1.2.8/src/util/ss/pager.c 2003-04-18 21:15:46.000000000 -0700
@@ -17,7 +17,11 @@
static char MORE[] = "more";
extern char *_ss_pager_name;
extern char *getenv();
+#ifdef __CYGWIN__
+#include <errno.h>
+#else
extern int errno;
+#endif
/*
* this needs a *lot* of work....
diff -u -r krb5-1.2.8-dist/src/util/ss/parse.c krb5-1.2.8/src/util/ss/parse.c
--- krb5-1.2.8-dist/src/util/ss/parse.c 1994-08-18 13:48:42.000000000 -0700
+++ krb5-1.2.8/src/util/ss/parse.c 2003-04-18 21:15:46.000000000 -0700
@@ -6,7 +6,9 @@
#include "ss_internal.h"
#include "copyright.h"
-
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
enum parse_mode { WHITESPACE, TOKEN, QUOTED_STRING };
More information about the krb5-bugs
mailing list