VirtualBox

Changeset 102345 in vbox for trunk/src/libs/xpcom18a4/ipc


Ignore:
Timestamp:
Nov 27, 2023 6:48:07 PM (14 months ago)
Author:
vboxsync
Message:

libs/xpcom: Replace remaining APIs from prprf.h with IPRT equivalents, bugref:10545

Location:
trunk/src/libs/xpcom18a4/ipc/ipcd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcdUnix.cpp

    r102343 r102345  
    5959#include <errno.h>
    6060
    61 #include "prprf.h"
    62 
    6361#include "ipcConfig.h"
    6462#include "ipcMessage.h"
     
    205203    //
    206204    char buf[32];
    207     int nb = PR_snprintf(buf, sizeof(buf), "%u\n", (unsigned long) getpid());
    208     write(ipcLockFD, buf, nb);
     205    ssize_t nb = RTStrPrintf2(buf, sizeof(buf), "%u\n", (unsigned long) getpid());
     206    if (nb <= 0)
     207        return ELockFileOpen;
     208    write(ipcLockFD, buf, (size_t)nb);
    209209
    210210    return EOk;
  • trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcConfig.h

    r3372 r102345  
    3939#define ipcProto_h__
    4040
    41 #if defined(XP_WIN)
    42 //
    43 // use WM_COPYDATA messages
    44 //
    45 #include "prprf.h"
    46 
    47 #define IPC_WINDOW_CLASS              "Mozilla:IPCWindowClass"
    48 #define IPC_WINDOW_NAME               "Mozilla:IPCWindow"
    49 #define IPC_CLIENT_WINDOW_CLASS       "Mozilla:IPCAppWindowClass"
    50 #define IPC_CLIENT_WINDOW_NAME_PREFIX "Mozilla:IPCAppWindow:"
    51 #define IPC_SYNC_EVENT_NAME           "Local\\MozillaIPCSyncEvent"
    52 #ifndef IPC_DAEMON_APP_NAME
    53 #define IPC_DAEMON_APP_NAME           "mozilla-ipcd.exe"
    54 #endif
    55 #define IPC_PATH_SEP_CHAR             '\\'
    56 #define IPC_MODULES_DIR               "ipc\\modules"
    57 
    58 #define IPC_CLIENT_WINDOW_NAME_MAXLEN (sizeof(IPC_CLIENT_WINDOW_NAME_PREFIX) + 20)
    59 
    60 // writes client name into buf.  buf must be at least
    61 // IPC_CLIENT_WINDOW_NAME_MAXLEN bytes in length.
    62 inline void IPC_GetClientWindowName(PRUint32 pid, char *buf)
    63 {
    64     PR_snprintf(buf, IPC_CLIENT_WINDOW_NAME_MAXLEN, "%s%u",
    65                 IPC_CLIENT_WINDOW_NAME_PREFIX, pid);
    66 }
    67 
    68 #else
    6941#include "nscore.h"
    7042//
     
    8961NS_HIDDEN_(void) IPC_GetDefaultSocketPath(char *buf, PRUint32 bufLen);
    9062
    91 #endif
    92 
    9363// common shared configuration values
    9464
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette