Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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