OBS User unknown 2007-06-19 23:19:20 +00:00 committed by Git OBS Bridge
parent 1e0d25f9a7
commit 714e8fef2e
3 changed files with 68 additions and 26 deletions

View File

@ -1,6 +1,8 @@
--- e2fsprogs-1.39/lib/uuid/Makefile.in
+++ e2fsprogs-1.39/lib/uuid/Makefile.in
@@ -19,6 +19,8 @@
Index: e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/Makefile.in
===================================================================
--- e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329.orig/lib/uuid/Makefile.in
+++ e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/Makefile.in
@@ -19,6 +19,8 @@ SMANPAGES= uuid.3 uuid_clear.3 uuid_comp
OBJS= clear.o \
compare.o \
copy.o \
@ -9,7 +11,7 @@
gen_uuid.o \
isnull.o \
pack.o \
@@ -30,6 +32,8 @@
@@ -30,6 +32,8 @@ OBJS= clear.o \
SRCS= $(srcdir)/clear.c \
$(srcdir)/compare.c \
$(srcdir)/copy.c \
@ -18,7 +20,7 @@
$(srcdir)/gen_uuid.c \
$(srcdir)/isnull.c \
$(srcdir)/pack.c \
@@ -82,7 +86,7 @@
@@ -82,7 +86,7 @@ tst_uuid: tst_uuid.o $(DEPSTATIC_LIBUUID
uuid_time: $(srcdir)/uuid_time.c $(DEPLIBUUID)
@echo " LD $@"
@ -27,9 +29,11 @@
$(LIBUUID)
uuid.3: $(DEP_SUBSTITUTE) $(srcdir)/uuid.3.in
--- e2fsprogs-1.39/lib/uuid/gen_uuid.c
+++ e2fsprogs-1.39/lib/uuid/gen_uuid.c
@@ -71,6 +71,10 @@
Index: e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/gen_uuid.c
===================================================================
--- e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329.orig/lib/uuid/gen_uuid.c
+++ e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/gen_uuid.c
@@ -74,6 +74,10 @@
#endif
#include "uuidP.h"
@ -40,7 +44,7 @@
#ifdef HAVE_SRANDOM
#define srand(x) srandom(x)
@@ -224,42 +228,55 @@
@@ -247,54 +251,75 @@ static int get_node_id(unsigned char *no
/* Assume that the gettimeofday() has microsecond granularity */
#define MAX_ADJUSTMENT 10
@ -116,7 +120,9 @@
*clock_high = clock_reg >> 32;
*clock_low = clock_reg;
*ret_clock_seq = clock_seq;
@@ -268,10 +285,16 @@
+ shm_detach(clock_time);
return 0;
}
void uuid_generate_time(uuid_t out)
{
@ -124,7 +130,8 @@
+
+ pthread_once(&m_uuid_init_guard, m_uuid_init_once);
+
+ if(m_uuid_sem_id != -1) uuid_sem_P(m_uuid_sem_id);
+ if(m_uuid_sem_id != -1)
+ uuid_sem_P(m_uuid_sem_id);
+
static unsigned char node_id[6];
static int has_init = 0;
@ -134,19 +141,22 @@
if (!has_init) {
if (get_node_id(node_id) <= 0) {
@@ -291,6 +314,10 @@
@@ -314,6 +339,11 @@ void uuid_generate_time(uuid_t out)
uu.time_hi_and_version = ((clock_mid >> 16) & 0x0FFF) | 0x1000;
memcpy(uu.node, node_id, 6);
uuid_pack(&uu, out);
+
+ if(m_uuid_sem_id != -1) uuid_sem_V(m_uuid_sem_id);
+ if(m_uuid_sem_id != -1)
+ uuid_sem_V(m_uuid_sem_id);
+
+ pthread_mutex_unlock(&m_uuid_mutex);
}
void uuid_generate_random(uuid_t out)
--- e2fsprogs-1.39/lib/uuid/pv.c
+++ e2fsprogs-1.39/lib/uuid/pv.c
Index: e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/pv.c
===================================================================
--- /dev/null
+++ e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/pv.c
@@ -0,0 +1,88 @@
+#include <sys/types.h>
+#include <sys/stat.h>
@ -222,7 +232,7 @@
+ struct sembuf sb;
+ sb.sem_num = 0;
+ sb.sem_op = op;
+ sb.sem_flg = /*SEM_UNDO*/0;
+ sb.sem_flg = SEM_UNDO;
+ return semop(id, &sb, 1);
+}
+
@ -236,8 +246,10 @@
+ return sem_pv(id, 1);
+}
+
--- e2fsprogs-1.39/lib/uuid/pv.h
+++ e2fsprogs-1.39/lib/uuid/pv.h
Index: e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/pv.h
===================================================================
--- /dev/null
+++ e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/pv.h
@@ -0,0 +1,9 @@
+#ifndef PV_H_INCLUDE_GUARD
+#define PV_H_INCLUDE_GUARD
@ -248,9 +260,11 @@
+
+#endif // PV_H_INCLUDE_GUARD
+
--- e2fsprogs-1.39/lib/uuid/shm.c
+++ e2fsprogs-1.39/lib/uuid/shm.c
@@ -0,0 +1,43 @@
Index: e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/shm.c
===================================================================
--- /dev/null
+++ e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/shm.c
@@ -0,0 +1,55 @@
+#include <sys/ipc.h>
+#include <sys/types.h>
+#include <sys/shm.h>
@ -292,11 +306,25 @@
+}
+
+void *shm_addr(int id) {
+ return shmat(id, NULL, 0);
+ void *p;
+
+ p = shmat(id, NULL, 0);
+ if (p == (void *)-1)
+ report("Cannot attach shared memory");
+ return p;
+}
--- e2fsprogs-1.39/lib/uuid/shm.h
+++ e2fsprogs-1.39/lib/uuid/shm.h
@@ -0,0 +1,9 @@
+
+void shm_detach(void *addr)
+{
+ if (shmdt(addr) == -1)
+ report("Cannot detach shared memory");
+}
+
Index: e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/shm.h
===================================================================
--- /dev/null
+++ e2fsprogs-1.39+1.40_WIP_20061114+PATCH20070329/lib/uuid/shm.h
@@ -0,0 +1,10 @@
+#ifndef SHM_H_INCLUDE_GUARD
+#define SHM_H_INCLUDE_GUARD
+
@ -304,5 +332,6 @@
+
+int shm_init(int project_id, size_t size);
+void *shm_addr(int id);
+void shm_detach(void *addr);
+
+#endif // SHM_H_INCLUDE_GUARD

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jun 19 11:06:52 CEST 2007 - mkoenig@suse.de
- fix e2fsprogs-1.39-uuid_duplicates.patch [#189640]
* detach shm segment after use
* set SEM_UNDO for semaphore operations, otherwise we do not
get a clean state after interruption by a signal
-------------------------------------------------------------------
Wed Apr 25 12:53:49 CEST 2007 - pth@suse.de

View File

@ -21,7 +21,7 @@ Obsoletes: ext2fs
PreReq: %install_info_prereq
Autoreqprov: on
Version: 1.39+1.40_WIP_20061114+PATCH20070329
Release: 9
Release: 23
Summary: Utilities for the Second Extended File System
URL: http://e2fsprogs.sourceforge.net
Source: %{name}-%{version}.tar.bz2
@ -254,6 +254,11 @@ rm -rf $RPM_BUILD_ROOT
%postun -n libcom_err -p /sbin/ldconfig
%changelog
* Tue Jun 19 2007 - mkoenig@suse.de
- fix e2fsprogs-1.39-uuid_duplicates.patch [#189640]
* detach shm segment after use
* set SEM_UNDO for semaphore operations, otherwise we do not
get a clean state after interruption by a signal
* Wed Apr 25 2007 - pth@suse.de
- Fix German translations.
* Wed Apr 11 2007 - mkoenig@suse.de