use socket_set_nonblocking
This commit is contained in:
@@ -34,25 +34,6 @@
|
|||||||
#include "kadm5_locl.h"
|
#include "kadm5_locl.h"
|
||||||
#include <fcntl.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
|
static kadm5_ret_t
|
||||||
kadm5_s_init_with_context(krb5_context context,
|
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);
|
ctx->log_context.socket_info->ai_protocol);
|
||||||
#endif
|
#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);
|
ret = krb5_parse_name(ctx->context, client_name, &ctx->caller);
|
||||||
if(ret)
|
if(ret)
|
||||||
|
Reference in New Issue
Block a user