Magellan Linux

Diff of /trunk/pcsc-lite/patches/pcsc-lite-1.7.4-systemd-disable-autostart.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1573 by niro, Thu Nov 24 20:58:47 2011 UTC revision 1574 by niro, Thu Nov 24 21:10:23 2011 UTC
# Line 1  Line 1 
1  This option disables pcscd autostarting code in the libpcsclite library.  From c7f825b2c4a5c7d4ac8abe5690737c2c8fffbfcc Mon Sep 17 00:00:00 2001
2    From: Kalev Lember <kalev@smartlink.ee>
3    Date: Fri, 24 Jun 2011 00:46:13 +0300
4    Subject: [PATCH 2/3] Add --disable-autostart option
5    
6  With systemd socket activation in place, pcscd can be started  This option disables pcscd autostarting code in the libpcsclite library.
 automatically by systemd when a request arrives on the IPC socket. That  
 makes starting the service as a fork from user library unnecessary.  
 ---  
  PCSC/configure.in        |   11 +++++++++++  
  PCSC/src/winscard_clnt.c |    6 ++++++  
  2 files changed, 17 insertions(+), 0 deletions(-)  
7    
8  diff --git a/PCSC/configure.in b/PCSC/configure.in  With systemd socket activation in place, pcscd can be started
9  index 831ee88..97e3360 100644  automatically by systemd when a request arrives on the IPC socket. That
10  --- a/PCSC/configure.in  makes starting the service as a fork from user library unnecessary.
11  +++ b/PCSC/configure.in  ---
12  @@ -274,6 +274,16 @@ if test x$use_libusb = xyes; then   PCSC/configure.in        |   11 +++++++++++
13     PCSCLITE_FEATURES="${PCSCLITE_FEATURES} libusb"   PCSC/src/winscard_clnt.c |    6 ++++++
14   fi   2 files changed, 17 insertions(+), 0 deletions(-)
15      
16  +# --disable-autostart  diff --git a/PCSC/configure.in b/PCSC/configure.in
17  +AC_ARG_ENABLE(autostart,  index 831ee88..97e3360 100644
18  +  AC_HELP_STRING([--disable-autostart], [disable pcscd automatic startup]),  --- a/PCSC/configure.in
19  +  [ use_autostart="${enableval}" ], [ use_autostart="yes" ] )  +++ b/PCSC/configure.in
20  +  @@ -274,6 +274,16 @@ if test x$use_libusb = xyes; then
21  +if test x$use_autostart != xno; then     PCSCLITE_FEATURES="${PCSCLITE_FEATURES} libusb"
22  +  AC_DEFINE(ENABLE_AUTOSTART, 1, [Enable pcscd automatic startup])   fi
23  +  PCSCLITE_FEATURES="${PCSCLITE_FEATURES} autostart"  
24  +fi  +# --disable-autostart
25  +  +AC_ARG_ENABLE(autostart,
26   # --enable-embedded  +  AC_HELP_STRING([--disable-autostart], [disable pcscd automatic startup]),
27   AC_ARG_ENABLE(embedded,  +  [ use_autostart="${enableval}" ], [ use_autostart="yes" ] )
28     AC_HELP_STRING([--enable-embedded], [limit RAM and CPU ressources by disabling features (log)]),  +
29  @@ -381,6 +391,7 @@ ATR parsing messages: ${debugatr}  +if test x$use_autostart != xno; then
30   ipcdir:               ${ipcdir}  +  AC_DEFINE(ENABLE_AUTOSTART, 1, [Enable pcscd automatic startup])
31   use serial:           ${use_serial}  +  PCSCLITE_FEATURES="${PCSCLITE_FEATURES} autostart"
32   use usb:              ${use_usb}  +fi
33  +use autostart:        ${use_autostart}  +
34       # --enable-embedded
35   PCSCLITE_FEATURES:    ${PCSCLITE_FEATURES}   AC_ARG_ENABLE(embedded,
36         AC_HELP_STRING([--enable-embedded], [limit RAM and CPU ressources by disabling features (log)]),
37  diff --git a/PCSC/src/winscard_clnt.c b/PCSC/src/winscard_clnt.c  @@ -381,6 +391,7 @@ ATR parsing messages: ${debugatr}
38  index 92c8481..982be01 100644   ipcdir:               ${ipcdir}
39  --- a/PCSC/src/winscard_clnt.c   use serial:           ${use_serial}
40  +++ b/PCSC/src/winscard_clnt.c   use usb:              ${use_usb}
41  @@ -444,8 +444,10 @@ LONG SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1,  +use autostart:        ${use_autostart}
42    LPCVOID pvReserved2, LPSCARDCONTEXT phContext)  
43   {   PCSCLITE_FEATURES:    ${PCSCLITE_FEATURES}
44    LONG rv;  
45  +#ifdef ENABLE_AUTOSTART  diff --git a/PCSC/src/winscard_clnt.c b/PCSC/src/winscard_clnt.c
46    int daemon_launched = FALSE;  index 92c8481..982be01 100644
47    int retries = 0;  --- a/PCSC/src/winscard_clnt.c
48  +#endif  +++ b/PCSC/src/winscard_clnt.c
49      @@ -444,8 +444,10 @@ LONG SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1,
50    API_TRACE_IN("%ld, %p, %p", dwScope, pvReserved1, pvReserved2)   LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
51    PROFILE_START   {
52  @@ -457,6 +459,7 @@ again:   LONG rv;
53    /* we reconnected to a daemon or we got called from a forked child */  +#ifdef ENABLE_AUTOSTART
54    rv = SCardCheckDaemonAvailability();   int daemon_launched = FALSE;
55       int retries = 0;
56  +#ifdef ENABLE_AUTOSTART  +#endif
57    if (SCARD_E_NO_SERVICE == rv)  
58    {   API_TRACE_IN("%ld, %p, %p", dwScope, pvReserved1, pvReserved2)
59   launch:   PROFILE_START
60  @@ -517,6 +520,7 @@ launch:  @@ -457,6 +459,7 @@ again:
61    goto again;   /* we reconnected to a daemon or we got called from a forked child */
62    }   rv = SCardCheckDaemonAvailability();
63    }  
64  +#endif  +#ifdef ENABLE_AUTOSTART
65       if (SCARD_E_NO_SERVICE == rv)
66    if (rv != SCARD_S_SUCCESS)   {
67    goto end;   launch:
68  @@ -526,6 +530,7 @@ launch:  @@ -517,6 +520,7 @@ launch:
69    pvReserved2, phContext);   goto again;
70    (void)SCardUnlockThread();   }
71       }
72  +#ifdef ENABLE_AUTOSTART  +#endif
73    /* SCardEstablishContextTH may fail if the previous pcscd crashed  
74    * without cleaning /var/run/pcscd/pcscd.comm */   if (rv != SCARD_S_SUCCESS)
75    if (SCARD_E_NO_SERVICE == rv)   goto end;
76  @@ -534,6 +539,7 @@ launch:  @@ -526,6 +530,7 @@ launch:
77    if (retries <= 1)   pvReserved2, phContext);
78    goto launch;   (void)SCardUnlockThread();
79    }  
80  +#endif  +#ifdef ENABLE_AUTOSTART
81       /* SCardEstablishContextTH may fail if the previous pcscd crashed
82   end:   * without cleaning /var/run/pcscd/pcscd.comm */
83    PROFILE_END(rv)   if (SCARD_E_NO_SERVICE == rv)
84    @@ -534,6 +539,7 @@ launch:
85     if (retries <= 1)
86     goto launch;
87     }
88    +#endif
89    
90     end:
91     PROFILE_END(rv)
92  --  --
93  1.7.5.4  1.7.5.4
94    

Legend:
Removed from v.1573  
changed lines
  Added in v.1574