mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 14:27:36 +00:00
2005-02-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* watchquagga.c: (try_connect) Use new set_nonblocking function instead of calling fcntl directly.
This commit is contained in:
parent
262feb1ad0
commit
52e66296f2
@ -1,3 +1,8 @@
|
|||||||
|
2005-02-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
|
* watchquagga.c: (try_connect) Use new set_nonblocking function instead
|
||||||
|
of calling fcntl directly.
|
||||||
|
|
||||||
2005-01-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
2005-01-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
* watchquagga.c: (run_job) Fix bug: delay.tv_sec was being used
|
* watchquagga.c: (run_job) Fix bug: delay.tv_sec was being used
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: watchquagga.c,v 1.9 2005/01/12 16:24:51 ajs Exp $
|
$Id: watchquagga.c,v 1.10 2005/02/16 20:40:25 ajs Exp $
|
||||||
|
|
||||||
Monitor status of quagga daemons and restart if necessary.
|
Monitor status of quagga daemons and restart if necessary.
|
||||||
|
|
||||||
@ -23,6 +23,7 @@
|
|||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <log.h>
|
#include <log.h>
|
||||||
|
#include <network.h>
|
||||||
#include <sigevent.h>
|
#include <sigevent.h>
|
||||||
#include <lib/version.h>
|
#include <lib/version.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -733,7 +734,6 @@ try_connect(struct daemon *dmn)
|
|||||||
int sock;
|
int sock;
|
||||||
struct sockaddr_un addr;
|
struct sockaddr_un addr;
|
||||||
socklen_t len;
|
socklen_t len;
|
||||||
int flags;
|
|
||||||
|
|
||||||
if (gs.loglevel > LOG_DEBUG+1)
|
if (gs.loglevel > LOG_DEBUG+1)
|
||||||
zlog_debug("%s: attempting to connect",dmn->name);
|
zlog_debug("%s: attempting to connect",dmn->name);
|
||||||
@ -766,18 +766,10 @@ try_connect(struct daemon *dmn)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set non-blocking. */
|
if (set_nonblocking(sock) < 0)
|
||||||
if ((flags = fcntl(sock, F_GETFL, 0)) < 0)
|
|
||||||
{
|
{
|
||||||
zlog_err("%s(%s): fcntl(F_GETFL) failed: %s",
|
zlog_err("%s(%s): set_nonblocking(%d) failed",
|
||||||
__func__,addr.sun_path, safe_strerror(errno));
|
__func__, addr.sun_path, sock);
|
||||||
close(sock);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (fcntl(sock, F_SETFL, (flags|O_NONBLOCK)) < 0)
|
|
||||||
{
|
|
||||||
zlog_err("%s(%s): fcntl(F_SETFL,O_NONBLOCK) failed: %s",
|
|
||||||
__func__,addr.sun_path, safe_strerror(errno));
|
|
||||||
close(sock);
|
close(sock);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user