Hello,

As long as status exists the hotplug scripts forks openct-control, even after 
shutdown.
Any reason why not remove the status file when openct-control shutdown is 
issued?

Alon.

---

Index: src/tools/openct-control.c
===================================================================
--- src/tools/openct-control.c  (revision 1042)
+++ src/tools/openct-control.c  (working copy)
@@ -157,6 +157,8 @@
                        killed++;
        }
 
+       ct_status_destroy();
+
        printf("%d process%s killed.\n", killed, (killed == 1) ? "" : "es");
        return 0;
 }
Index: src/include/openct/openct.h
===================================================================
--- src/include/openct/openct.h (revision 1042)
+++ src/include/openct/openct.h (working copy)
@@ -91,6 +91,7 @@
                                unsigned short address,
                                const void *send_buf, size_t send_len);
 
+extern int             ct_status_destroy(void);
 extern int             ct_status_clear(unsigned int, const char *);
 extern ct_info_t *     ct_status_alloc_slot(int *);
 extern int             ct_status_update(ct_info_t *);
Index: src/ct/status.c
===================================================================
--- src/ct/status.c     (revision 1042)
+++ src/ct/status.c     (working copy)
@@ -63,6 +63,17 @@
        return addr;
 }
 
+int ct_status_destroy(void)
+{
+       char status_path[PATH_MAX];
+
+       if (!ct_format_path(status_path, PATH_MAX, "status")) {
+               return -1;
+       }
+
+       return unlink(status_path);
+}
+
 int ct_status_clear(unsigned int count, const char *owner)
 {
        int fd = -1;
Index: etc/init-script.in
===================================================================
--- etc/init-script.in  (revision 1043)
+++ etc/init-script.in  (working copy)
@@ -33,7 +33,6 @@
   stop)
        echo -n "Stopping $DESC: $NAME "
        $DAEMON shutdown
-       rm "@OPENCT_SOCKET_PATH@/status"
        echo "."
        ;;
   #reload)
_______________________________________________
opensc-devel mailing list
[email protected]
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to