Make kdc build on windows

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:
Asanka Herath
2009-11-24 22:19:37 -08:00
committed by Love Hornquist Astrand
parent caf8f87598
commit b191b1e12f
10 changed files with 125 additions and 64 deletions

View File

@@ -144,13 +144,19 @@ main(int argc, char **argv)
if(ret)
unlink(new);
else {
#ifndef NO_POSIX_LINKS
unlink(old);
if(link(keyfile, old) < 0 && errno != ENOENT) {
ret = errno;
unlink(new);
} else if(rename(new, keyfile) < 0) {
ret = errno;
} else {
#endif
if(rename(new, keyfile) < 0) {
ret = errno;
}
#ifndef NO_POSIX_LINKS
}
#endif
}
out:
free(old);