Make write() and sendto() properly handle short writes and errors in ndhc.

Make ndhc write a pidfile.
Clean up defines.h and split out ifchd and ndhc specifics.
This commit is contained in:
Nicholas J. Kain
2010-11-12 18:44:49 -05:00
parent e781322b4d
commit eb6009a5ee
7 changed files with 82 additions and 30 deletions

View File

@@ -1,12 +1,14 @@
#define MAX_PATH_LENGTH 1024
#ifndef IFCHD_DEFINES_H_
#define IFCHD_DEFINES_H_
#include "defines.h"
#define PID_FILE_DEFAULT "/var/run/ifchd.pid"
#define IFCHD_VERSION "0.8"
#define COMM_SOCKET_PATH "ifchange"
#define MAX_BUF 1024
#define MAXLINE 1024
#define SOCK_QUEUE 2
#define CONN_TIMEOUT 60
#define LINUX 1
#endif /* IFCHD_DEFINES_H_ */

View File

@@ -1,5 +1,5 @@
/* ifchd.c - interface change daemon
* Time-stamp: <2010-11-12 17:22:34 njk>
* Time-stamp: <2010-11-12 18:40:54 njk>
*
* (C) 2004-2010 Nicholas J. Kain <njkain at gmail dot com>
*
@@ -39,7 +39,7 @@
#define _GNU_SOURCE
#include <getopt.h>
#include "defines.h"
#include "ifchd-defines.h"
#include "malloc.h"
#include "log.h"
#include "chroot.h"

View File

@@ -1,5 +1,5 @@
/* linux.c - ifchd Linux-specific functions
* Time-stamp: <2010-11-12 14:29:32 njk>
* Time-stamp: <2010-11-12 18:41:15 njk>
*
* (C) 2004-2010 Nicholas J. Kain <njkain at gmail dot com>
*
@@ -37,7 +37,7 @@
#include <errno.h>
#include "defines.h"
#include "ifchd-defines.h"
#include "log.h"
#include "strlist.h"
#include "ifproto.h"