Remove unnecessary os_procName and os_procNamePid functions

Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
This commit is contained in:
Jeroen Koekkoek 2018-12-28 11:06:39 +01:00
parent a2aab8eab2
commit 0bc263e537
34 changed files with 33 additions and 455 deletions

View file

@ -149,17 +149,10 @@ dds_init(dds_domainid_t domain)
/* Set additional default participant properties */
gv.default_plist_pp.process_id = (unsigned)os_procIdSelf();
gv.default_plist_pp.process_id = (unsigned)os_getpid();
gv.default_plist_pp.present |= PP_PRISMTECH_PROCESS_ID;
if (os_procName(progname, sizeof(progname)) > 0)
{
gv.default_plist_pp.exec_name = dds_string_dup(progname);
}
else
{
gv.default_plist_pp.exec_name = dds_string_alloc(32);
(void) snprintf(gv.default_plist_pp.exec_name, 32, "%s: %u", DDSC_PROJECT_NAME, gv.default_plist_pp.process_id);
}
gv.default_plist_pp.exec_name = dds_string_alloc(32);
(void) snprintf(gv.default_plist_pp.exec_name, 32, "%s: %u", DDSC_PROJECT_NAME, gv.default_plist_pp.process_id);
len = (uint32_t) (13 + strlen(gv.default_plist_pp.exec_name));
gv.default_plist_pp.present |= PP_PRISMTECH_EXEC_NAME;
if (os_gethostname(hostname, sizeof(hostname)) == os_resultSuccess)

View file

@ -41,7 +41,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -47,7 +47,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -51,7 +51,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -312,7 +312,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -68,7 +68,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -68,7 +68,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -61,7 +61,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -65,7 +65,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -85,7 +85,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -43,7 +43,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -69,7 +69,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -38,7 +38,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -43,7 +43,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -61,7 +61,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -67,7 +67,7 @@ void ddsi_iid_init (void)
os_mutexInit (&gv.dds_iid.lock);
#endif
gv.dds_iid.key[0] = (uint32_t) os_procIdSelf();
gv.dds_iid.key[0] = (uint32_t) os_getpid();
gv.dds_iid.key[1] = (uint32_t) tnow.v;
gv.dds_iid.key[2] = (uint32_t) (tnow.v >> 32);
gv.dds_iid.key[3] = 0xdeadbeef;

View file

@ -1050,7 +1050,7 @@ int rtps_init (void)
/* Template PP guid -- protected by privileged_pp_lock for simplicity */
gv.next_ppguid.prefix.u[0] = locator_to_hopefully_unique_uint32 (&gv.ownloc);
gv.next_ppguid.prefix.u[1] = (unsigned) os_procIdSelf ();
gv.next_ppguid.prefix.u[1] = (unsigned) os_getpid ();
gv.next_ppguid.prefix.u[2] = 1;
gv.next_ppguid.entityid.u = NN_ENTITYID_PARTICIPANT;