Go to English page

ViaThinkSoft CodeLib

Dieser Artikel befindet sich in der Kategorie:
CodeLibProgrammierhilfenC / C++

//********************************************************************************************
//
// pwb_save_timestamp
//
// Speichert den aktuellen Unix-Zeitstempel, um die Aktivität des Daemons zu signalisieren

const char*                LAST_RUN_FILE = "last_run";

static void pwb_save_timestamp() {
        int unix_time = (int) time (NULL); // Unix-Zeitstempel

        FILE* logfile = fopen(LAST_RUN_FILE, "w+");

        if (logfile == NULL) {
                log_event(VERBOSE_LEVEL_WARNING, "Could not write to the timestamp file");
                return;
        }

        fprintf(logfile, "%d", unix_time);
        fclose(logfile);
}

pwb_save_timestamp() war in pwb_new_run(). Nun abgelöst durch promoter-check/.
Daniel Marschall
ViaThinkSoft Mitbegründer