OBS User unknown 2007-09-13 22:44:45 +00:00 committed by Git OBS Bridge
parent 159a5bea6a
commit fe484fcc7e
3 changed files with 52 additions and 3 deletions

40
bnc-309132.patch Normal file
View File

@ -0,0 +1,40 @@
diff -Naur libdaemon-0.12/libdaemon/dpid.c /suse/mauro/libdaemon/libdaemon/dpid.c
--- libdaemon-0.12/libdaemon/dpid.c 2007-07-10 19:58:34.000000000 +0200
+++ /suse/mauro/libdaemon/libdaemon/dpid.c 2007-09-13 22:15:16.046491000 +0200
@@ -1,4 +1,4 @@
-/* $Id: dpid.c 125 2007-06-22 15:09:47Z lennart $ */
+/* $Id: dpid.c 131 2007-09-10 16:52:17Z lennart $ */
/*
* This file is part of libdaemon.
@@ -69,6 +69,14 @@
f.l_len = 0;
if (fcntl(fd, F_SETLKW, &f) < 0) {
+
+ if (enable && errno == EBADF) {
+ f.l_type = F_RDLCK;
+
+ if (fcntl(fd, F_SETLKW, &f) >= 0)
+ return 0;
+ }
+
daemon_log(LOG_WARNING, "fcntl(F_SETLKW) failed: %s", strerror(errno));
return -1;
}
@@ -91,10 +99,12 @@
}
if ((fd = open(fn, O_RDWR, 0644)) < 0) {
- if (errno != ENOENT)
- daemon_log(LOG_WARNING, "Failed to open PID file: %s", strerror(errno));
+ if ((fd = open(fn, O_RDONLY, 0644)) < 0) {
+ if (errno != ENOENT)
+ daemon_log(LOG_WARNING, "Failed to open PID file: %s", strerror(errno));
- goto finish;
+ goto finish;
+ }
}
if ((locked = lock_file(fd, 1)) < 0)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Sep 13 22:37:06 CEST 2007 - mauro@suse.de
- Applied a patch from upstream, to fix bnc #309132.
-------------------------------------------------------------------
Sun Jul 22 17:12:13 CEST 2007 - coolo@suse.de

View File

@ -12,16 +12,18 @@
Name: libdaemon
BuildRequires: doxygen
URL: http://0pointer.de/lennart/projects/libdaemon/
Url: http://0pointer.de/lennart/projects/libdaemon/
Version: 0.12
Release: 4
Release: 15
Summary: Lightweight C library That Eases the Writing of UNIX Daemons
License: LGPL v2 or later
Group: System/Libraries
Source: %{name}-%{version}.tar.bz2
Patch0: libdaemon-0.10-testd-fix-FD_SET.diff
Patch1: bnc-309132.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Prefix: /usr
%package devel
Summary: libdaemon is a lightweight C library that eases the writing of UNIX daemons.
Group: Development/Libraries/C and C++
@ -54,7 +56,6 @@ Authors:
--------
Lennart Poettering <mzqnrzba (at) 0pointer (dot) de>
%description devel
libdaemon is a lightweight C library that eases the writing of UNIX
daemons. It consists of the following parts:
@ -85,6 +86,7 @@ Authors:
%prep
%setup
%patch0 -p0
%patch1 -p1
%build
export CFLAGS="$RPM_OPT_FLAGS"
@ -116,6 +118,8 @@ rm -rf $RPM_BUILD_ROOT
/usr/include/libdaemon
%changelog
* Thu Sep 13 2007 - mauro@suse.de
- Applied a patch from upstream, to fix bnc #309132.
* Sun Jul 22 2007 - coolo@suse.de
- disable lynx as it adds little featurewise (the README is packaged
in the tar), but make libdaemon build pretty late and we need it