Author: oden
Date: Tue Oct 31 19:09:35 2006
New Revision: 74667

Added:
   packages/cooker/gamin/current/SOURCES/gamin-0.1.7-cvsfixes.patch
Removed:
   packages/cooker/gamin/current/SOURCES/gamin-0.1.7-cvsfixes.patch.bz2
Modified:
   packages/cooker/gamin/current/SPECS/gamin.spec

Log:
- bunzip patches


Added: packages/cooker/gamin/current/SOURCES/gamin-0.1.7-cvsfixes.patch
==============================================================================
--- (empty file)
+++ packages/cooker/gamin/current/SOURCES/gamin-0.1.7-cvsfixes.patch    Tue Oct 
31 19:09:35 2006
@@ -0,0 +1,195 @@
+--- gamin-0.1.7/lib/gam_error.c.cvsfixes       2005-09-08 09:46:45.000000000 
+0200
++++ gamin-0.1.7/lib/gam_error.c        2006-09-01 18:51:08.000000000 +0200
+@@ -76,7 +76,7 @@
+ gam_error_init(void)
+ {
+     if (initialized == 0) {
+-        signal_handler prev;
++        struct sigaction oldact;
+ 
+         initialized = 1;
+ 
+@@ -89,11 +89,12 @@
+             gam_error_handle_signal();
+         }
+ 
+-        prev = signal(SIGUSR2, gam_error_signal);
+-        /* if there is already an handler switch back to the original
+-         * to avoid disturbing the application behaviour */
+-        if ((prev != SIG_IGN) && (prev != SIG_DFL) && (prev != NULL))
+-            signal(SIGUSR2, prev);
++      /* if there is already an handler, leave it as is to
++       * avoid disturbing the application's behaviour */
++      if (sigaction (SIGUSR2, NULL, &oldact) == 0) {
++          if (oldact.sa_handler == NULL && oldact.sa_sigaction == NULL)
++              signal(SIGUSR2, gam_error_signal);
++      }
+     }
+ }
+ 
+--- gamin-0.1.7/libgamin/gam_api.c.cvsfixes    2005-08-06 00:31:46.000000000 
+0200
++++ gamin-0.1.7/libgamin/gam_api.c     2006-09-01 18:51:08.000000000 +0200
+@@ -744,7 +744,6 @@
+     return(0);
+ 
+ failed:
+-    close(fd);
+     return (-1);
+ }
+ 
+@@ -891,39 +890,38 @@
+     /*
+      * try to reopen a connection to the server
+      */
+-    close(fd);
+     newfd = gamin_connect_unix_socket(socket_name);
+-
+     free(socket_name);
+     if (newfd < 0) {
+         return (-1);
+     }
+ 
+-    if (newfd != fd) {
+-      /*
+-       * reuse the same descriptor
+-       */
+-      ret = dup2(newfd, fd);
+-      if (ret < 0) {
+-          gam_error(DEBUG_INFO,
+-                    "Failed to reuse descriptor %d on reconnect\n",
+-                    fd);
+-          close(newfd);
+-          return (-1);
+-      }
+-    }
+-
+     /*
+      * seems we managed to rebuild a connection to the server.
+      * start the authentication again and resubscribe all existing
+      * monitoring commands.
+      */
+-    ret = gamin_write_credential_byte(fd);
++    ret = gamin_write_credential_byte(newfd);
+     if (ret != 0) {
+-        close(fd);
++        close(newfd);
+         return (-1);
+     }
+ 
++    /*
++     * reuse the same descriptor. We never close the original fd, dup2
++     * atomically overwrites it and closes the original. This way we
++     * never leave the original fd closed, since that can cause trouble
++     * if the app keeps the fd around.
++     */
++    ret = dup2(newfd, fd);
++    close(newfd);
++    if (ret < 0) {
++      gam_error(DEBUG_INFO,
++                "Failed to reuse descriptor %d on reconnect\n",
++                fd);
++      return (-1);
++    }
++    
+     nb_req = gamin_data_reset(conn, &reqs);
+     if (reqs != NULL) {
+       for (i = 0; i < nb_req;i++) {
+--- gamin-0.1.7/libgamin/gam_data.c.cvsfixes   2005-09-09 13:01:27.000000000 
+0200
++++ gamin-0.1.7/libgamin/gam_data.c    2006-09-01 18:51:08.000000000 +0200
+@@ -29,7 +29,7 @@
+  * libraries.
+  */
+ #ifdef __GNUC__
+-#ifdef linux
++#ifdef linux || defined(__GLIBC__)
+ #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
+ extern int pthread_mutexattr_init(pthread_mutexattr_t *attr)
+            __attribute((weak));
+@@ -459,7 +459,6 @@
+         if ((pthread_mutexattr_init != NULL) &&
+           (pthread_mutexattr_settype != NULL) &&
+           (pthread_mutex_init != NULL) &&
+-          (pthread_mutexattr_destroy != NULL) &&
+           (pthread_mutex_lock != NULL) &&
+           (pthread_mutex_unlock != NULL) &&
+           (pthread_mutexattr_destroy != NULL)) {
+@@ -540,6 +539,7 @@
+     conn->reqno = 1;
+     conn->restarted = 1;
+     conn->evn_ready = 0;
++    conn->evn_read = 0;
+     return(conn->req_nr);
+ }
+ 
+--- gamin-0.1.7/libgamin/gam_fork.c.cvsfixes   2005-10-27 12:51:03.000000000 
+0200
++++ gamin-0.1.7/libgamin/gam_fork.c    2006-09-01 18:51:08.000000000 +0200
+@@ -67,6 +67,7 @@
+     /* Become a daemon */
+     pid = fork();
+     if (pid == 0) {
++      int fd;
+         long open_max;
+       long i;
+ 
+@@ -75,6 +76,20 @@
+       for (i = 0; i < open_max; i++)
+           fcntl (i, F_SETFD, FD_CLOEXEC);
+ 
++      /* /dev/null for stdin, stdout, stderr */
++      fd = open ("/dev/null", O_RDONLY);
++      if (fd != -1) {
++          dup2 (fd, 0);
++          close (fd);
++      }
++      
++      fd = open ("/dev/null", O_WRONLY);
++      if (fd != -1) {
++          dup2 (fd, 1);
++          dup2 (fd, 2);
++          close (fd);
++      }
++      
+         setsid();
+         if (fork() == 0) {
+ #ifdef HAVE_SETENV
+--- gamin-0.1.7/server/gam_inotify.c.cvsfixes  2005-10-25 16:16:28.000000000 
+0200
++++ gamin-0.1.7/server/gam_inotify.c   2006-09-01 18:51:08.000000000 +0200
+@@ -34,11 +34,18 @@
+ #endif
+ #include "gam_error.h"
+ #include "gam_poll_basic.h"
++#ifdef HAVE_LINUX_TYPES_H
++#include <linux/types.h> /* for __u32 */
++#endif
+ #ifdef HAVE_LINUX_INOTIFY_H
+ #include <linux/inotify.h>
+ #else
++#ifdef HAVE_SYS_INOTIFY_H
++#include <sys/inotify.h>
++#else
+ #include "local_inotify.h"
+ #endif
++#endif
+ #include "local_inotify_syscalls.h"
+ #include "gam_inotify.h"
+ #include "gam_tree.h"
+--- gamin-0.1.7/server/local_inotify_syscalls.h.cvsfixes       2005-08-17 
15:50:04.000000000 +0200
++++ gamin-0.1.7/server/local_inotify_syscalls.h        2006-09-01 
18:51:08.000000000 +0200
+@@ -1,3 +1,4 @@
++#ifndef _SYS_INOTIFY_H
+ #ifndef _LINUX_INOTIFY_SYSCALLS_H
+ #define _LINUX_INOTIFY_SYSCALLS_H
+ 
+@@ -81,3 +82,4 @@
+ #endif
+ 
+ #endif /* _LINUX_INOTIFY_SYSCALLS_H */
++#endif /* _SYS_INOTIFY_H */
+--- gamin-0.1.7/gamin.pc.in.cvsfixes   2005-03-30 12:55:19.000000000 +0200
++++ gamin-0.1.7/gamin.pc.in    2006-09-01 18:51:08.000000000 +0200
+@@ -7,4 +7,4 @@
+ Description: The gamin file monitoring system.
+ Version: @GAMIN_VERSION@
+ Libs: -L${libdir} -lgamin-1
+-Cflags: -I${includedir}/fam
++Cflags: -I${includedir}

Modified: packages/cooker/gamin/current/SPECS/gamin.spec
==============================================================================
--- packages/cooker/gamin/current/SPECS/gamin.spec      (original)
+++ packages/cooker/gamin/current/SPECS/gamin.spec      Tue Oct 31 19:09:35 2006
@@ -5,12 +5,12 @@
 Summary: Library providing the FAM File Alteration Monitor API
 Name: gamin
 Version: 0.1.7
-Release: %mkrel 3
+Release: %mkrel 4
 License: LGPL
 Group: Monitoring
 Source0: http://www.gnome.org/~veillard/gamin/sources/gamin-%{version}.tar.bz2
 # (fc) 0.1.7-2mdv various CVS fixes
-Patch0: gamin-0.1.7-cvsfixes.patch.bz2
+Patch0: gamin-0.1.7-cvsfixes.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 URL: http://www.gnome.org/~veillard/gamin/

Reply via email to