Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
ipcConfig.cpp File Reference
#include <string.h>
#include "ipcConfig.h"
#include "ipcLog.h"
#include "prenv.h"
#include "plstr.h"

Go to the source code of this file.


void IPC_GetDefaultSocketPath (char *buf, PRUint32 bufLen)


static const char kDefaultSocketPrefix [] = "/tmp/.mozilla-"
static const char kDefaultSocketSuffix [] = "-ipc/ipcd"

Function Documentation

void IPC_GetDefaultSocketPath ( char *  buf,
PRUint32  bufLen 

Definition at line 54 of file ipcConfig.cpp.

    const char *logName;
    int len;

    PL_strncpyz(buf, kDefaultSocketPrefix, bufLen);
    buf    += (sizeof(kDefaultSocketPrefix) - 1);
    bufLen -= (sizeof(kDefaultSocketPrefix) - 1);

    logName = PR_GetEnv("LOGNAME");
    if (!logName || !logName[0]) {
        logName = PR_GetEnv("USER");
        if (!logName || !logName[0]) {
            LOG(("could not determine username from environment\n"));
            goto end;
    PL_strncpyz(buf, logName, bufLen);
    len = strlen(logName);
    buf    += len;
    bufLen -= len;

    PL_strncpyz(buf, kDefaultSocketSuffix, bufLen);

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const char kDefaultSocketPrefix[] = "/tmp/.mozilla-" [static]

Definition at line 50 of file ipcConfig.cpp.

const char kDefaultSocketSuffix[] = "-ipc/ipcd" [static]

Definition at line 51 of file ipcConfig.cpp.