use socket_set_nonblocking

This commit is contained in:
Love Hornquist Astrand
2013-04-24 16:31:32 -07:00
parent 72f0690694
commit 6e5bfce2de

View File

@@ -34,25 +34,6 @@
#include "kadm5_locl.h"
#include <fcntl.h>
RCSID("$Id$");
#ifndef O_NONBLOCK
#define NBLK FNDELAY
#else
#define NBLK O_NONBLOCK
#endif
static int non_blocking(int fd, int on)
{
int flags;
if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
return -1;
if (fcntl(fd, F_SETFL, on ? flags | NBLK : flags & ~NBLK) < 0)
return -1;
return ((flags & NBLK) != 0);
}
static kadm5_ret_t
kadm5_s_init_with_context(krb5_context context,
@@ -110,7 +91,7 @@ kadm5_s_init_with_context(krb5_context context,
ctx->log_context.socket_info->ai_protocol);
#endif
non_blocking(ctx->log_context.socket_fd, 1);
socket_set_nonblocking(ctx->log_context.socket_fd, 1);
ret = krb5_parse_name(ctx->context, client_name, &ctx->caller);
if(ret)