diff options
author | obache <obache@pkgsrc.org> | 2007-07-29 06:58:59 +0000 |
---|---|---|
committer | obache <obache@pkgsrc.org> | 2007-07-29 06:58:59 +0000 |
commit | 31f7689b959ced7dd2f220ccfaa28d5719d4798d (patch) | |
tree | 200584ebdae5881fbce86e266ba28382a7a1307d /net/spreadlogd/patches | |
parent | aa699c46281476accdbfbe2f2f32a58e5d368b08 (diff) | |
download | pkgsrc-31f7689b959ced7dd2f220ccfaa28d5719d4798d.tar.gz |
Import spreadlogd version 2.0.0.
Packaged and provided by Mark Blackman via PR 36348.
Spreadlogd is a general purpose daemon for receiving Spread toolkit
broadcast/multicast messages and logging them either to a file or for further
processing by a Perl module as an interpreter is embedded.
Diffstat (limited to 'net/spreadlogd/patches')
-rw-r--r-- | net/spreadlogd/patches/patch-aa | 104 | ||||
-rw-r--r-- | net/spreadlogd/patches/patch-ab | 16 | ||||
-rw-r--r-- | net/spreadlogd/patches/patch-ac | 15 |
3 files changed, 135 insertions, 0 deletions
diff --git a/net/spreadlogd/patches/patch-aa b/net/spreadlogd/patches/patch-aa new file mode 100644 index 00000000000..36f2afba6b6 --- /dev/null +++ b/net/spreadlogd/patches/patch-aa @@ -0,0 +1,104 @@ +$NetBSD: patch-aa,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $ + +--- config.c.orig 2006-05-05 20:25:41.000000000 +0100 ++++ config.c +@@ -301,6 +301,15 @@ int config_close(void) { + SpreadConfiguration *sc; + LogFacility *lf; + int i; ++#ifdef HAVE_FCNTL_H ++ struct flock fl; ++ ++ fl.l_type = F_UNLCK; /* tell it to unlock the region */ ++ fl.l_whence = SEEK_SET; /* SEEK_SET, SEEK_CUR, SEEK_END */ ++ fl.l_start = 0; /* Offset from l_whence */ ++ fl.l_len = 0; /* length, 0 = to EOF */ ++ fl.l_pid = getpid(); /* our PID */ ++#endif + sciter = sl_getlist(&spreaddaemons); + if(!sciter) return 0; + sc = (SpreadConfiguration *)sciter->data; +@@ -314,13 +323,23 @@ int config_close(void) { + if(lf->vhostdir) { + for (i=0;i< FHASH_SIZE;i++) { + if(lf->hash[i].fd>0) { +- if(!skiplocking) flock(lf->hash[i].fd, LOCK_UN); ++ if(!skiplocking) ++#ifdef HAVE_FCNTL_H ++ fcntl(lf->hash[i].fd, F_SETLK, &fl); ++#else ++ flock(lf->hash[i].fd, LOCK_UN); ++#endif + close(lf->hash[i].fd); + lf->hash[i].fd = -1; + } + } + } else if(lf->logfile && lf->logfile->fd>0) { +- if(!skiplocking) flock(lf->logfile->fd, LOCK_UN); ++ if(!skiplocking) ++#ifdef HAVE_FCNTL_H ++ fcntl(lf->logfile->fd, F_SETLK, &fl); ++#else ++ flock(lf->logfile->fd, LOCK_UN); ++#endif + close(lf->logfile->fd); + lf->logfile->fd = -1; + } +@@ -356,6 +375,15 @@ int config_start(void) { + struct skiplistnode *sciter, *lfiter; + SpreadConfiguration *sc; + LogFacility *lf; ++#ifdef HAVE_FCNTL_H ++ struct flock fl; ++ ++ fl.l_type = F_WRLCK; /* F_RDLCK, F_WRLCK, F_UNLCK */ ++ fl.l_whence = SEEK_SET; /* SEEK_SET, SEEK_CUR, SEEK_END */ ++ fl.l_start = 0; /* Offset from l_whence */ ++ fl.l_len = 0; /* length, 0 = to EOF */ ++ fl.l_pid = getpid(); /* our PID */ ++#endif + sciter = sl_getlist(&spreaddaemons); + if(!sciter) return 0; + sc = (SpreadConfiguration *)sciter->data; +@@ -381,7 +409,11 @@ int config_start(void) { + } + } + if(!skiplocking) { +- if(flock(lf->logfile->fd, LOCK_NB|LOCK_EX)==-1) { ++#ifdef HAVE_FCNTL_H ++ if(fcntl(lf->logfile->fd, F_SETLK, &fl)==-1) { ++#else ++ if(flock(lf->logfile->fd, LOCK_NB|LOCK_EX)==-1) { ++#endif + fprintf(stderr, "Cannot lock %s, is another spreadlogd running?\n", + lf->logfile->filename); + exit(1); +@@ -441,6 +473,15 @@ int config_get_fd(SpreadConfiguration *s + hash_element temp; + char *cp; + char fullpath[MAXPATHLEN]; ++#ifdef HAVE_FCNTL_H ++ struct flock fl; ++ ++ fl.l_type = F_WRLCK; /* F_RDLCK, F_WRLCK, F_UNLCK */ ++ fl.l_whence = SEEK_SET; /* SEEK_SET, SEEK_CUR, SEEK_END */ ++ fl.l_start = 0; /* Offset from l_whence */ ++ fl.l_len = 0; /* length, 0 = to EOF */ ++ fl.l_pid = getpid(); /* our PID */ ++#endif + lf = sl_find(sc->logfacilities, group, NULL); + if(!lf || !lf->logfile || !lf->logfile->filename) return -1; + if(lf->vhostdir) { +@@ -457,7 +498,11 @@ int config_get_fd(SpreadConfiguration *s + O_CREAT|O_APPEND|O_WRONLY, + 00644); + if(!skiplocking) { +- if(flock(temp.fd, LOCK_NB|LOCK_EX)==-1) { ++#ifdef HAVE_FCNTL_H ++ if(fcntl(temp.fd, F_SETLK, &fl)==-1) { ++#else ++ if(flock(temp.fd, LOCK_NB|LOCK_EX)==-1) { ++#endif + fprintf(stderr, "Cannot lock %s, is another spreadlogd running?\n", + fullpath); + exit(1); diff --git a/net/spreadlogd/patches/patch-ab b/net/spreadlogd/patches/patch-ab new file mode 100644 index 00000000000..1ff6cb23521 --- /dev/null +++ b/net/spreadlogd/patches/patch-ab @@ -0,0 +1,16 @@ +$NetBSD: patch-ab,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $ + +--- echash.h.orig 2006-05-04 13:21:46.000000000 +0100 ++++ echash.h +@@ -88,11 +88,4 @@ API_EXPORT(int) echash_next(ec_hash_tabl + API_EXPORT(int) echash_firstkey(ec_hash_table *h, const char **k, int *klen); + API_EXPORT(int) echash_nextkey(ec_hash_table *h, const char **k, int *klen, char *lk, int lklen); + +-/* This function serves no real API use sans calculating expected buckets +- for keys (or extending the hash... which is unsupported) */ +-API_EXPORT(unsigned int) echash__hash(const char *k, u_int32_t length, +- u_int32_t initval); +-API_EXPORT(ec_hash_bucket *) echash__new_bucket(const char *k, int klen, +- void *data); +-API_EXPORT(void) echash__rebucket(ec_hash_table *h, int newsize); + #endif diff --git a/net/spreadlogd/patches/patch-ac b/net/spreadlogd/patches/patch-ac new file mode 100644 index 00000000000..57abd4794ef --- /dev/null +++ b/net/spreadlogd/patches/patch-ac @@ -0,0 +1,15 @@ +$NetBSD: patch-ac,v 1.1.1.1 2007/07/29 06:58:59 obache Exp $ + +--- Makefile.in.orig 2007-05-16 09:47:12.216090000 +0100 ++++ Makefile.in +@@ -53,8 +53,8 @@ spreadlogd: $(OBJS) + install: spreadlogd + $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) + $(INSTALL) -m 0755 spreadlogd $(DESTDIR)$(sbindir)/spreadlogd +- $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir) +- $(INSTALL) -m 0755 spreadlogd.conf $(DESTDIR)$(sysconfdir)/spreadlogd.conf.sample ++# $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir) ++# $(INSTALL) -m 0755 spreadlogd.conf $(DESTDIR)$(sysconfdir)/spreadlogd.conf.sample + + clean: + rm -f *~ *.o spreadlogd libskiplist.a y.tab.h y.tab.c lex.sld_.c \ |