示例#1
0
static void
parsePidfile(const char *      const p,
             struct _TServer * const srvP) {
    bool succeeded;
    succeeded = FileOpenCreate(&srvP->pidfileP, p, O_TRUNC | O_WRONLY);
    if (!succeeded) {
        srvP->pidfileP = NULL;
        TraceMsg("Bad PidFile value '%s'", p);
    };
}
示例#2
0
static void
parsePidfile(const char *      const p,
             struct _TServer * const srvP) {
#ifdef _UNIX
    if (!FileOpenCreate(&srvP->pidfile, p, O_TRUNC | O_WRONLY)) {
        srvP->pidfile = -1;
        TraceMsg("Bad PidFile value '%s'", p);
    };
#else
    TraceMsg("PidFile option ignored");
#endif  /* _UNIX */
}
示例#3
0
文件: conf.c 项目: odmanV2/freecenter
static void
parsePidfile(const char *      const p,
             struct _TServer * const srvP) {
#ifdef _UNIX
    bool succeeded;
    succeeded = FileOpenCreate(&srvP->pidfileP, p, O_TRUNC | O_WRONLY);
    if (!succeeded) {
        srvP->pidfileP = NULL;
        TraceMsg("Bad PidFile value '%s'", p);
    };
#else
    TraceMsg("PidFile option ignored");
#endif  /* _UNIX */ 
}
示例#4
0
static void
logOpen(struct _TServer * const srvP,
        const char **     const errorP) {

    bool success;

    success = FileOpenCreate(&srvP->logfileP, srvP->logfilename,
                             O_WRONLY | O_APPEND);
    if (success) {
        bool success;
        success = MutexCreate(&srvP->logmutexP);
        if (success) {
            *errorP = NULL;
            srvP->logfileisopen = TRUE;
        } else
            xmlrpc_asprintf(errorP, "Can't create mutex for log file");
            
        if (*errorP)
            FileClose(srvP->logfileP);
    } else
        xmlrpc_asprintf(errorP, "Can't open log file '%s'", srvP->logfilename);
}
static abyss_bool
logOpen(struct _TServer * const srvP) {

    abyss_bool success;

    success = FileOpenCreate(&srvP->logfile, srvP->logfilename,
                             O_WRONLY | O_APPEND);
    if (success) {
        abyss_bool success;
        success = MutexCreate(&srvP->logmutex);
        if (success)
            srvP->logfileisopen = TRUE;
        else
            TraceMsg("Can't create mutex for log file");

        if (!success)
            FileClose(&srvP->logfile);
    } else
        TraceMsg("Can't open log file '%s'", srvP->logfilename);

    return success;
}