- lockdev errs on /dev/input/ttyACM0 (3-component pathname) (#126082,

#98160, #74454)
This commit is contained in:
kzak 2005-02-23 12:21:13 +00:00
parent 303c5bf015
commit e42515b565
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,24 @@
--- lockdev-1.0.1/src/lockdev.c.subdir 2005-02-23 12:57:52.253199688 +0100
+++ lockdev-1.0.1/src/lockdev.c 2005-02-23 13:08:27.193674064 +0100
@@ -245,10 +245,19 @@
char * name;
const char * dev;
{
- int l;
- _debug( 3, "_dl_filename_2 (dev=%s)\n", dev);
+ int l, x;
+ char *p;
+
/* lockfile of type /var/lock/LCK..ttyS2 */
+ _debug( 3, "_dl_filename_2 (dev=%s)\n", dev);
+ x = strlen(LOCK_PATH) + 6; /* 6= strlen("/LCK..") */
l = sprintf( name, "%s/LCK..%s", LOCK_PATH, dev);
+
+ /* replace '/' by '_' for /dev sub-dirs (like pppd does it)
+ */
+ while ((p = strchr(name+x, '/')) != NULL) {
+ *p = '_';
+ }
_debug( 2, "_dl_filename_2 () -> len=%d, name=%s<\n", l, name);
return l;
}

View File

@ -1,7 +1,7 @@
Summary: A library for locking devices. Summary: A library for locking devices.
Name: lockdev Name: lockdev
Version: 1.0.1 Version: 1.0.1
Release: 4 Release: 5
License: LGPL License: LGPL
Group: System Environment/Libraries Group: System Environment/Libraries
Source: http://ftp.debian.org/debian/pool/main/l/lockdev/%{name}_%{version}.orig.tar.gz Source: http://ftp.debian.org/debian/pool/main/l/lockdev/%{name}_%{version}.orig.tar.gz
@ -11,6 +11,7 @@ Patch2: lockdev-1.0.0-signal.patch
Patch3: lockdev-1.0.0-cli.patch Patch3: lockdev-1.0.0-cli.patch
Patch4: lockdev-1.0.1-checkname.patch Patch4: lockdev-1.0.1-checkname.patch
Patch5: lockdev-1.0.1-pidexists.patch Patch5: lockdev-1.0.1-pidexists.patch
Patch6: lockdev-1.0.1-subdir.patch
Prereq: shadow-utils, filesystem >= 2.1.4-1 Prereq: shadow-utils, filesystem >= 2.1.4-1
BuildRoot: %{_tmppath}/%{name}-root BuildRoot: %{_tmppath}/%{name}-root
@ -36,6 +37,7 @@ package contains the development headers and a static library.
%patch3 -p1 -b .jbj %patch3 -p1 -b .jbj
%patch4 -p1 -b .checkname %patch4 -p1 -b .checkname
%patch5 -p1 -b .pidexists %patch5 -p1 -b .pidexists
%patch6 -p1 -b .subdir
%build %build
make "CFLAGS=${RPM_OPT_FLAGS} -fPIC" make "CFLAGS=${RPM_OPT_FLAGS} -fPIC"
@ -75,6 +77,9 @@ rm -fr $RPM_BUILD_ROOT
%{_includedir}/* %{_includedir}/*
%changelog %changelog
* Wed Feb 23 2005 Karel Zak <kzak@redhat.com> 1.0.1-5
- lockdev errs on /dev/input/ttyACM0 (3-component pathname) (#126082, #98160, #74454)
* Fri Oct 22 2004 Adrian Havill <havill@redhat.com> 1.0.1-4 * Fri Oct 22 2004 Adrian Havill <havill@redhat.com> 1.0.1-4
- don't unlock files if pid still exists (#128104) - don't unlock files if pid still exists (#128104)