From 6e5bfce2dee011c9629f14d716d09bb64dfd3fa6 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Wed, 24 Apr 2013 16:31:32 -0700 Subject: [PATCH] use socket_set_nonblocking --- lib/kadm5/init_s.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/lib/kadm5/init_s.c b/lib/kadm5/init_s.c index 43bad3ebf..67154254a 100644 --- a/lib/kadm5/init_s.c +++ b/lib/kadm5/init_s.c @@ -34,25 +34,6 @@ #include "kadm5_locl.h" #include -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)