auto-import changelog data from lockdev-1.0.0-11.src.rpm

Tue Aug 14 2001 Jeff Johnson <jbj@redhat.com>
- set exit status correctly.
This commit is contained in:
cvsdist 2004-09-09 07:58:33 +00:00
parent 09bdfe40b0
commit 973ca3a6df
2 changed files with 38 additions and 27 deletions

View File

@ -1,5 +1,5 @@
--- lockdev-1.0.0/src/sample.c.rh Wed Dec 1 06:50:09 1999 --- lockdev-1.0.0/src/sample.c.rh Wed Dec 1 06:50:09 1999
+++ lockdev-1.0.0/src/sample.c Thu Aug 9 22:46:37 2001 +++ lockdev-1.0.0/src/sample.c Tue Aug 14 14:27:39 2001
@@ -3,27 +3,26 @@ @@ -3,27 +3,26 @@
void void
@ -36,7 +36,7 @@
case 'd': case 'd':
debug = atoi(++p); debug = atoi(++p);
break; break;
@@ -32,31 +31,20 @@ @@ -32,31 +31,28 @@
} }
else dev = p; else dev = p;
} }
@ -68,15 +68,24 @@
default: default:
- i = dev_testlock( dev); - i = dev_testlock( dev);
+ if (dev) + if (dev)
+ i = dev_testlock(dev); + i = dev_testlock(dev);
break; break;
} }
- exit( i); - exit( i);
+ exit(i); -}
}
+ /*
+ * Exit dev_lock dev_unlock dev_testlock
+ * 0 OK OK not locked
+ * 1 locked other locked other locked
+ * 255 fail fail fail
+ */
+ if (i < 0) i = 255;
+ else if (i > 0) i = 1;
+ exit(i);
+}
--- lockdev-1.0.0/src/lockdev.c.rh Wed Dec 1 06:43:47 1999 --- lockdev-1.0.0/src/lockdev.c.rh Wed Dec 1 06:43:47 1999
+++ lockdev-1.0.0/src/lockdev.c Thu Aug 9 22:48:42 2001 +++ lockdev-1.0.0/src/lockdev.c Tue Aug 14 14:25:55 2001
@@ -176,6 +176,19 @@ @@ -176,6 +176,19 @@
liblockdev_debug = 0; liblockdev_debug = 0;
} }
@ -111,7 +120,7 @@
_debug( 3, "dev_lock(%s)\n", devname); _debug( 3, "dev_lock(%s)\n", devname);
if (oldmask == -1 ) if (oldmask == -1 )
- oldmask = umask( 0); /* give full permissions to files created */ - oldmask = umask( 0); /* give full permissions to files created */
+ oldmask = umask( 002); + oldmask = umask( 002); /* apply o-w to files created */
if ( ! (p=_dl_check_devname( devname)) ) if ( ! (p=_dl_check_devname( devname)) )
close_n_return( -1); close_n_return( -1);
strcpy( device, DEV_PATH); strcpy( device, DEV_PATH);
@ -119,7 +128,7 @@
if ( stat( device, &statbuf) == -1 ) { if ( stat( device, &statbuf) == -1 ) {
close_n_return( -1); close_n_return( -1);
} }
+ if ( access( device, W_OK ) == -1 ) { + if ( access( device, W_OK ) == -1 ) {
+ close_n_return( -1); + close_n_return( -1);
+ } + }
@ -134,47 +143,45 @@
_debug( 3, "dev_relock(%s, %d)\n", devname, (int)old_pid); _debug( 3, "dev_relock(%s, %d)\n", devname, (int)old_pid);
if (oldmask == -1 ) if (oldmask == -1 )
- oldmask = umask( 0); /* give full permissions to files created */ - oldmask = umask( 0); /* give full permissions to files created */
+ oldmask = umask( 002); + oldmask = umask( 002); /* apply o-w to files created */
if ( ! (p=_dl_check_devname( devname)) ) if ( ! (p=_dl_check_devname( devname)) )
close_n_return( -1); close_n_return( -1);
strcpy( device, DEV_PATH); strcpy( device, DEV_PATH);
@@ -755,9 +771,11 @@ @@ -755,9 +771,12 @@
if ( stat( device, &statbuf) == -1 ) { if ( stat( device, &statbuf) == -1 ) {
close_n_return( -1); close_n_return( -1);
} }
- + if ( access( device, W_OK ) == -1 ) {
+ if ( access( device, W_OK ) == -1 ) {
+ close_n_return( -1); + close_n_return( -1);
+ } + }
/* now get our own pid */ /* now get our own pid */
- our_pid = getpid(); - our_pid = getpid();
+ our_pid = dev_getpid(); + our_pid = dev_getpid();
_debug( 2, "dev_relock() our own pid = %d\n", (int)our_pid); _debug( 2, "dev_relock() our own pid = %d\n", (int)our_pid);
/* first check for the FSSTND-1.2 lock, get the pid of the /* first check for the FSSTND-1.2 lock, get the pid of the
@@ -828,7 +846,7 @@ @@ -828,7 +847,7 @@
#endif /* DEBUG */ #endif /* DEBUG */
_debug( 3, "dev_unlock(%s, %d)\n", devname, (int)pid); _debug( 3, "dev_unlock(%s, %d)\n", devname, (int)pid);
if (oldmask == -1 ) if (oldmask == -1 )
- oldmask = umask( 0); /* give full permissions to files created */ - oldmask = umask( 0); /* give full permissions to files created */
+ oldmask = umask( 002); + oldmask = umask( 002); /* apply o-w to files created */
if ( ! (p=_dl_check_devname( devname)) ) if ( ! (p=_dl_check_devname( devname)) )
close_n_return( -1); close_n_return( -1);
strcpy( device, DEV_PATH); strcpy( device, DEV_PATH);
@@ -841,7 +859,10 @@ @@ -841,6 +860,9 @@
if ( stat( device, &statbuf) == -1 ) { if ( stat( device, &statbuf) == -1 ) {
close_n_return( -1); close_n_return( -1);
} }
- + if ( access( device, W_OK ) == -1 ) {
+ if ( access( device, W_OK ) == -1 ) {
+ close_n_return( -1); + close_n_return( -1);
+ } + }
+
/* first remove the FSSTND-1.2 lock, get the pid of the /* first remove the FSSTND-1.2 lock, get the pid of the
* owner of the lock and test for its existence; in case, * owner of the lock and test for its existence; in case,
* return the pid of the owner of the lock.
--- lockdev-1.0.0/src/lockdev.h.rh Wed Dec 1 06:39:42 1999 --- lockdev-1.0.0/src/lockdev.h.rh Wed Dec 1 06:39:42 1999
+++ lockdev-1.0.0/src/lockdev.h Thu Aug 9 22:46:37 2001 +++ lockdev-1.0.0/src/lockdev.h Tue Aug 14 14:19:58 2001
@@ -60,6 +60,9 @@ @@ -60,6 +60,9 @@
void liblockdev_incr_debug __P(()); void liblockdev_incr_debug __P(());
void liblockdev_reset_debug __P(()); void liblockdev_reset_debug __P(());
@ -185,9 +192,9 @@
pid_t dev_testlock __P(( const char * devname)); pid_t dev_testlock __P(( const char * devname));
pid_t dev_lock __P(( const char * devname)); pid_t dev_lock __P(( const char * devname));
--- lockdev-1.0.0/src/baudboy.h.rh Thu Aug 9 22:46:37 2001 --- lockdev-1.0.0/src/baudboy.h.rh Tue Aug 14 14:19:58 2001
+++ lockdev-1.0.0/src/baudboy.h Thu Aug 9 22:46:37 2001 +++ lockdev-1.0.0/src/baudboy.h Tue Aug 14 14:21:37 2001
@@ -0,0 +1,82 @@ @@ -0,0 +1,83 @@
+#ifndef _BADUBOY_H_ +#ifndef _BADUBOY_H_
+#define _BAUDBOY_H_ +#define _BAUDBOY_H_
+ +
@ -220,8 +227,9 @@
+ dup2(fd, 0); + dup2(fd, 0);
+ dup2(fd, 1); + dup2(fd, 1);
+ dup2(fd, 2); + dup2(fd, 2);
+ execv(argv[0], (char *const *)argv); + close(fd);
+ exit(-1); + execv(argv[0], (char *const *)argv);
+ exit(-1);
+ } + }
+ +
+ rc = (int) waitpid(child, &status, 0); + rc = (int) waitpid(child, &status, 0);
@ -271,7 +279,7 @@
+ +
+#endif /* _BAUDBOY_H_ */ +#endif /* _BAUDBOY_H_ */
--- lockdev-1.0.0/Makefile.rh Wed Dec 1 05:56:22 1999 --- lockdev-1.0.0/Makefile.rh Wed Dec 1 05:56:22 1999
+++ lockdev-1.0.0/Makefile Thu Aug 9 22:46:37 2001 +++ lockdev-1.0.0/Makefile Tue Aug 14 14:19:58 2001
@@ -6,6 +6,8 @@ @@ -6,6 +6,8 @@
objs = src/lockdev.o objs = src/lockdev.o

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.0 Version: 1.0.0
Release: 10 Release: 11
Copyright: LGPL Copyright: LGPL
Group: System Environment/Libraries Group: System Environment/Libraries
Source: ftp://ftp.debian.org/debian/dists/woody/main/source/libs/lockdev_1.0.0.tar.gz Source: ftp://ftp.debian.org/debian/dists/woody/main/source/libs/lockdev_1.0.0.tar.gz
@ -63,6 +63,9 @@ rm -fr $RPM_BUILD_ROOT
%{_includedir}/* %{_includedir}/*
%changelog %changelog
* Tue Aug 14 2001 Jeff Johnson <jbj@redhat.com>
- set exit status correctly.
* Thu Aug 9 2001 Bill Nottingham <notting@redhat.com> * Thu Aug 9 2001 Bill Nottingham <notting@redhat.com>
- check that we can open the device r/w before locking - check that we can open the device r/w before locking
- fix calling lockdev without any arguments - fix calling lockdev without any arguments