Changeset 1047

Show
Ignore:
Timestamp:
05/17/08 08:46:37 (7 months ago)
Author:
alonbl
Message:

Delete status on shutdown

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/etc/init-script.in

    r1043 r1047  
    3434        echo -n "Stopping $DESC: $NAME " 
    3535        $DAEMON shutdown 
    36         rm "@OPENCT_SOCKET_PATH@/status" 
    3736        echo "." 
    3837        ;; 
  • trunk/src/ct/status.c

    r1042 r1047  
    6464} 
    6565 
     66int ct_status_destroy(void) 
     67{ 
     68        char status_path[PATH_MAX]; 
     69 
     70        if (!ct_format_path(status_path, PATH_MAX, "status")) { 
     71                return -1; 
     72        } 
     73 
     74        return unlink(status_path); 
     75} 
     76 
    6677int ct_status_clear(unsigned int count, const char *owner) 
    6778{ 
  • trunk/src/include/openct/openct.h

    r1042 r1047  
    9292                                const void *send_buf, size_t send_len); 
    9393 
     94extern int              ct_status_destroy(void); 
    9495extern int              ct_status_clear(unsigned int, const char *); 
    9596extern ct_info_t *      ct_status_alloc_slot(int *); 
  • trunk/src/tools/openct-control.c

    r1042 r1047  
    158158        } 
    159159 
     160        ct_status_destroy(); 
     161 
    160162        printf("%d process%s killed.\n", killed, (killed == 1) ? "" : "es"); 
    161163        return 0;