Fix memleaks by including string.h where needed.

While here, switch to new REVISION/DEPENDS.
This commit is contained in:
ajacoutot 2010-07-13 14:10:35 +00:00
parent 256d90190a
commit b4900052b8
3 changed files with 35 additions and 15 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.8 2010/06/30 20:48:30 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.9 2010/07/13 14:10:35 ajacoutot Exp $
COMMENT-main= file and directory monitoring system
COMMENT-server= gamin file monitoring server
@ -7,9 +7,14 @@ COMMENT-python= gamin Python bindings
GNOME_PROJECT= gamin
GNOME_VERSION= 0.1.10
PKGNAME-main= libgamin-${GNOME_VERSION}p1
PKGNAME-server= ${DISTNAME}p5
PKGNAME-main= libgamin-${GNOME_VERSION}
REVISION-main= 2
PKGNAME-server= ${DISTNAME}
REVISION-server=6
PKGNAME-python= py-gamin-${GNOME_VERSION}
REVISION-python=0
SHARED_LIBS += gamin-1 0.0 # .1.10
SHARED_LIBS += fam 1.0 # .0.0
@ -37,15 +42,15 @@ LIB_DEPENDS-main=
RUN_DEPENDS-main=
LIB_DEPENDS-server= ${LIB_DEPENDS} \
glib-2.0.>=1800::devel/glib2
::devel/glib2
LIB_DEPENDS-python= gamin-1::sysutils/gamin,-main
LIB_DEPENDS-python= ::sysutils/gamin,-main
.if !${FLAVOR:L:Mno_server}
MULTI_PACKAGES+= -server
MODULES+= devel/gettext
CONFIGURE_ARGS+= --enable-server
WANTLIB-server += c pcre
WANTLIB-server += c pcre glib-2.0.>=1800
.else
CONFIGURE_ARGS+= --disable-server
.endif
@ -53,6 +58,7 @@ CONFIGURE_ARGS+= --disable-server
.if !${FLAVOR:L:Mno_python}
MULTI_PACKAGES+= -python
MODULES+= lang/python
WANTLIB-python += gamin-1
.else
CONFIGURE_ARGS+= --without-python
.endif

View File

@ -1,7 +1,15 @@
$OpenBSD: patch-libgamin_gam_api_c,v 1.3 2010/06/30 20:48:30 ajacoutot Exp $
$OpenBSD: patch-libgamin_gam_api_c,v 1.4 2010/07/13 14:10:35 ajacoutot Exp $
--- libgamin/gam_api.c.orig Mon Aug 27 12:21:03 2007
+++ libgamin/gam_api.c Wed Jun 30 22:34:27 2010
@@ -712,7 +712,11 @@ retry:
+++ libgamin/gam_api.c Tue Jul 13 15:52:47 2010
@@ -4,6 +4,7 @@
#include "config.h"
#include <pwd.h>
+#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -712,7 +713,11 @@ retry:
{
#ifdef SO_PEERCRED
@ -13,7 +21,7 @@ $OpenBSD: patch-libgamin_gam_api_c,v 1.3 2010/06/30 20:48:30 ajacoutot Exp $
socklen_t cr_len = sizeof(cr);
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) ==
@@ -1288,14 +1292,16 @@ FAMNextEvent(FAMConnection * fc, FAMEvent * fe)
@@ -1288,14 +1293,16 @@ FAMNextEvent(FAMConnection * fc, FAMEvent * fe)
// FIXME: drop and reacquire lock while blocked?
gamin_data_lock(conn);

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-server_gam_channel_c,v 1.3 2010/06/30 20:48:30 ajacoutot Exp $
$OpenBSD: patch-server_gam_channel_c,v 1.4 2010/07/13 14:10:35 ajacoutot Exp $
From FreeBSD:
Restore the stale socket cleanup code from gamin 0.1.5 to ensure that even
@ -6,8 +6,14 @@ if gamin crashes or is killed with SIGKILL, a leftover socket does not
prevent gam_server from starting.
--- server/gam_channel.c.orig Wed Jul 4 15:36:49 2007
+++ server/gam_channel.c Wed Jun 30 22:34:54 2010
@@ -153,7 +153,11 @@ gam_client_conn_check_cred(GIOChannel * source, int fd
+++ server/gam_channel.c Tue Jul 13 15:53:14 2010
@@ -1,4 +1,5 @@
#include "server_config.h"
+#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
@@ -153,7 +154,11 @@ gam_client_conn_check_cred(GIOChannel * source, int fd
{
#ifdef SO_PEERCRED
@ -19,7 +25,7 @@ prevent gam_server from starting.
socklen_t cr_len = sizeof(cr);
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) ==
@@ -620,6 +624,7 @@ gam_listen_unix_socket(const char *path)
@@ -620,6 +625,7 @@ gam_listen_unix_socket(const char *path)
{
int fd;
struct sockaddr_un addr;
@ -27,7 +33,7 @@ prevent gam_server from starting.
fd = socket(PF_UNIX, SOCK_STREAM, 0);
if (fd < 0) {
@@ -640,8 +645,18 @@ gam_listen_unix_socket(const char *path)
@@ -640,8 +646,18 @@ gam_listen_unix_socket(const char *path)
* some extra protection checks. Also make sure the socket is created
* with restricted mode
*/