The following example closes a log file (log_file_ID = 2) that was opened with LogOpenFile.

        #define INCL_LOGGING
        #include <unichar.h>
        #include <os2.h>
        #include <stdio.h>
                .
                .
                .
     {
        APIRET rc;                      /* return code */
        ULONG service;
        LCFREQUEST close_file_packet;

        service = ERROR_LOGGING_SERVICE;

        /*   Construct the LogOpenFile parameter packet  */
        close_file_packet.packet_size = sizeof(LCFREQUEST);
        close_file_packet.packet_revision_number = WPOS_RELEASE_1;
        close_file_packet.log_file_ID = 2;

        rc = LogCloseFile(service,                      /* service */
                                &close_file_packet)      /* parameter packet  */
        if (rc != 0)
                {
                printf("LogCloseFile error: return code = %d",rc);
                return;


[Back: LogCloseFile - Related Functions]
[Next: LogCloseFile - Topics]