summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2013-03-08 13:15:36 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2013-03-08 23:29:22 +0100
commit15b2d2bb258483c191efb51ee6366c26318fd9f9 (patch)
tree5bc7076a9c48f5ee3cea23fe6250d787c721cc6f
parent73df9770b39ad486c6ed4d5a392d950c6eb065f5 (diff)
downloaddbus-15b2d2bb258483c191efb51ee6366c26318fd9f9.tar.gz
Rename the term 'unix_pid' to 'pid' in variables and functions.
Windows also has numeric process IDs that fit in an unsigned long, so there's no reason this has to be Unix-specific. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61787 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--dbus/dbus-auth-script.c2
-rw-r--r--dbus/dbus-credentials-util.c12
-rw-r--r--dbus/dbus-credentials.c32
-rw-r--r--dbus/dbus-credentials.h4
-rw-r--r--dbus/dbus-sysdeps-unix.c4
-rw-r--r--dbus/dbus-sysdeps-win.c2
-rw-r--r--dbus/dbus-transport.c2
7 files changed, 29 insertions, 29 deletions
diff --git a/dbus/dbus-auth-script.c b/dbus/dbus-auth-script.c
index 6285e3ba..cbdd748f 100644
--- a/dbus/dbus-auth-script.c
+++ b/dbus/dbus-auth-script.c
@@ -223,7 +223,7 @@ auth_set_unix_credentials(DBusAuth *auth,
if (uid != DBUS_UID_UNSET)
_dbus_credentials_add_unix_uid (credentials, uid);
if (pid != DBUS_PID_UNSET)
- _dbus_credentials_add_unix_pid (credentials, pid);
+ _dbus_credentials_add_pid (credentials, pid);
_dbus_auth_set_credentials (auth, credentials);
diff --git a/dbus/dbus-credentials-util.c b/dbus/dbus-credentials-util.c
index 02771966..59cdcb83 100644
--- a/dbus/dbus-credentials-util.c
+++ b/dbus/dbus-credentials-util.c
@@ -40,7 +40,7 @@
static DBusCredentials*
make_credentials(dbus_uid_t unix_uid,
- dbus_pid_t unix_pid,
+ dbus_pid_t pid,
const char *windows_sid)
{
DBusCredentials *credentials;
@@ -56,9 +56,9 @@ make_credentials(dbus_uid_t unix_uid,
}
}
- if (unix_pid != DBUS_PID_UNSET)
+ if (pid != DBUS_PID_UNSET)
{
- if (!_dbus_credentials_add_unix_pid (credentials, unix_pid))
+ if (!_dbus_credentials_add_pid (credentials, pid))
{
_dbus_credentials_unref (credentials);
return NULL;
@@ -102,7 +102,7 @@ _dbus_credentials_test (const char *test_data_dir)
_dbus_assert (_dbus_credentials_include (creds, DBUS_CREDENTIAL_WINDOWS_SID));
_dbus_assert (_dbus_credentials_get_unix_uid (creds) == 12);
- _dbus_assert (_dbus_credentials_get_unix_pid (creds) == 511);
+ _dbus_assert (_dbus_credentials_get_pid (creds) == 511);
_dbus_assert (strcmp (_dbus_credentials_get_windows_sid (creds), SAMPLE_SID) == 0);
_dbus_assert (!_dbus_credentials_are_empty (creds));
@@ -118,7 +118,7 @@ _dbus_credentials_test (const char *test_data_dir)
_dbus_assert (_dbus_credentials_include (creds2, DBUS_CREDENTIAL_WINDOWS_SID));
_dbus_assert (_dbus_credentials_get_unix_uid (creds2) == 12);
- _dbus_assert (_dbus_credentials_get_unix_pid (creds2) == 511);
+ _dbus_assert (_dbus_credentials_get_pid (creds2) == 511);
_dbus_assert (strcmp (_dbus_credentials_get_windows_sid (creds2), SAMPLE_SID) == 0);
_dbus_assert (_dbus_credentials_are_superset (creds, creds2));
@@ -192,7 +192,7 @@ _dbus_credentials_test (const char *test_data_dir)
_dbus_assert (!_dbus_credentials_include (creds, DBUS_CREDENTIAL_WINDOWS_SID));
_dbus_assert (_dbus_credentials_get_unix_uid (creds) == DBUS_UID_UNSET);
- _dbus_assert (_dbus_credentials_get_unix_pid (creds) == DBUS_PID_UNSET);
+ _dbus_assert (_dbus_credentials_get_pid (creds) == DBUS_PID_UNSET);
_dbus_assert (_dbus_credentials_get_windows_sid (creds) == NULL);
_dbus_assert (_dbus_credentials_are_empty (creds));
diff --git a/dbus/dbus-credentials.c b/dbus/dbus-credentials.c
index ff69f3b0..7325125c 100644
--- a/dbus/dbus-credentials.c
+++ b/dbus/dbus-credentials.c
@@ -48,7 +48,7 @@
struct DBusCredentials {
int refcount;
dbus_uid_t unix_uid;
- dbus_pid_t unix_pid;
+ dbus_pid_t pid;
char *windows_sid;
void *adt_audit_data;
dbus_int32_t adt_audit_data_size;
@@ -77,7 +77,7 @@ _dbus_credentials_new (void)
creds->refcount = 1;
creds->unix_uid = DBUS_UID_UNSET;
- creds->unix_pid = DBUS_PID_UNSET;
+ creds->pid = DBUS_PID_UNSET;
creds->windows_sid = NULL;
creds->adt_audit_data = NULL;
creds->adt_audit_data_size = 0;
@@ -146,10 +146,10 @@ _dbus_credentials_unref (DBusCredentials *credentials)
* @returns #FALSE if no memory
*/
dbus_bool_t
-_dbus_credentials_add_unix_pid (DBusCredentials *credentials,
- dbus_pid_t pid)
+_dbus_credentials_add_pid (DBusCredentials *credentials,
+ dbus_pid_t pid)
{
- credentials->unix_pid = pid;
+ credentials->pid = pid;
return TRUE;
}
@@ -231,7 +231,7 @@ _dbus_credentials_include (DBusCredentials *credentials,
switch (type)
{
case DBUS_CREDENTIAL_UNIX_PROCESS_ID:
- return credentials->unix_pid != DBUS_PID_UNSET;
+ return credentials->pid != DBUS_PID_UNSET;
case DBUS_CREDENTIAL_UNIX_USER_ID:
return credentials->unix_uid != DBUS_UID_UNSET;
case DBUS_CREDENTIAL_WINDOWS_SID:
@@ -252,9 +252,9 @@ _dbus_credentials_include (DBusCredentials *credentials,
* @returns UNIX process ID
*/
dbus_pid_t
-_dbus_credentials_get_unix_pid (DBusCredentials *credentials)
+_dbus_credentials_get_pid (DBusCredentials *credentials)
{
- return credentials->unix_pid;
+ return credentials->pid;
}
/**
@@ -322,8 +322,8 @@ _dbus_credentials_are_superset (DBusCredentials *credentials,
DBusCredentials *possible_subset)
{
return
- (possible_subset->unix_pid == DBUS_PID_UNSET ||
- possible_subset->unix_pid == credentials->unix_pid) &&
+ (possible_subset->pid == DBUS_PID_UNSET ||
+ possible_subset->pid == credentials->pid) &&
(possible_subset->unix_uid == DBUS_UID_UNSET ||
possible_subset->unix_uid == credentials->unix_uid) &&
(possible_subset->windows_sid == NULL ||
@@ -345,7 +345,7 @@ dbus_bool_t
_dbus_credentials_are_empty (DBusCredentials *credentials)
{
return
- credentials->unix_pid == DBUS_PID_UNSET &&
+ credentials->pid == DBUS_PID_UNSET &&
credentials->unix_uid == DBUS_UID_UNSET &&
credentials->windows_sid == NULL &&
credentials->adt_audit_data == NULL;
@@ -410,9 +410,9 @@ _dbus_credentials_add_credential (DBusCredentials *credentials,
DBusCredentials *other_credentials)
{
if (which == DBUS_CREDENTIAL_UNIX_PROCESS_ID &&
- other_credentials->unix_pid != DBUS_PID_UNSET)
+ other_credentials->pid != DBUS_PID_UNSET)
{
- if (!_dbus_credentials_add_unix_pid (credentials, other_credentials->unix_pid))
+ if (!_dbus_credentials_add_pid (credentials, other_credentials->pid))
return FALSE;
}
else if (which == DBUS_CREDENTIAL_UNIX_USER_ID &&
@@ -445,7 +445,7 @@ _dbus_credentials_add_credential (DBusCredentials *credentials,
void
_dbus_credentials_clear (DBusCredentials *credentials)
{
- credentials->unix_pid = DBUS_PID_UNSET;
+ credentials->pid = DBUS_PID_UNSET;
credentials->unix_uid = DBUS_UID_UNSET;
dbus_free (credentials->windows_sid);
credentials->windows_sid = NULL;
@@ -523,9 +523,9 @@ _dbus_credentials_to_string_append (DBusCredentials *credentials,
goto oom;
join = TRUE;
}
- if (credentials->unix_pid != DBUS_PID_UNSET)
+ if (credentials->pid != DBUS_PID_UNSET)
{
- if (!_dbus_string_append_printf (string, "%spid=" DBUS_PID_FORMAT, join ? " " : "", credentials->unix_pid))
+ if (!_dbus_string_append_printf (string, "%spid=" DBUS_PID_FORMAT, join ? " " : "", credentials->pid))
goto oom;
join = TRUE;
}
diff --git a/dbus/dbus-credentials.h b/dbus/dbus-credentials.h
index ef6124fd..abcc4bb3 100644
--- a/dbus/dbus-credentials.h
+++ b/dbus/dbus-credentials.h
@@ -41,7 +41,7 @@ DBusCredentials* _dbus_credentials_new_from_current_process (void);
DBusCredentials* _dbus_credentials_new (void);
void _dbus_credentials_ref (DBusCredentials *credentials);
void _dbus_credentials_unref (DBusCredentials *credentials);
-dbus_bool_t _dbus_credentials_add_unix_pid (DBusCredentials *credentials,
+dbus_bool_t _dbus_credentials_add_pid (DBusCredentials *credentials,
dbus_pid_t pid);
dbus_bool_t _dbus_credentials_add_unix_uid (DBusCredentials *credentials,
dbus_uid_t uid);
@@ -52,7 +52,7 @@ dbus_bool_t _dbus_credentials_add_adt_audit_data (DBusCredentials
dbus_int32_t size);
dbus_bool_t _dbus_credentials_include (DBusCredentials *credentials,
DBusCredentialType type);
-dbus_pid_t _dbus_credentials_get_unix_pid (DBusCredentials *credentials);
+dbus_pid_t _dbus_credentials_get_pid (DBusCredentials *credentials);
dbus_uid_t _dbus_credentials_get_unix_uid (DBusCredentials *credentials);
const char* _dbus_credentials_get_windows_sid (DBusCredentials *credentials);
void * _dbus_credentials_get_adt_audit_data (DBusCredentials *credentials);
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index a0310592..30606ff9 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -1863,7 +1863,7 @@ _dbus_read_credentials_socket (int client_fd,
if (pid_read != DBUS_PID_UNSET)
{
- if (!_dbus_credentials_add_unix_pid (credentials, pid_read))
+ if (!_dbus_credentials_add_pid (credentials, pid_read))
{
_DBUS_SET_OOM (error);
return FALSE;
@@ -2318,7 +2318,7 @@ _dbus_credentials_add_from_current_process (DBusCredentials *credentials)
_dbus_assert (sizeof (uid_t) <= sizeof (dbus_uid_t));
_dbus_assert (sizeof (gid_t) <= sizeof (dbus_gid_t));
- if (!_dbus_credentials_add_unix_pid(credentials, _dbus_getpid()))
+ if (!_dbus_credentials_add_pid(credentials, _dbus_getpid()))
return FALSE;
if (!_dbus_credentials_add_unix_uid(credentials, _dbus_geteuid()))
return FALSE;
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index f8189af7..ce60d29e 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -1794,7 +1794,7 @@ _dbus_credentials_add_from_current_process (DBusCredentials *credentials)
if (!_dbus_getsid(&sid))
goto failed;
- if (!_dbus_credentials_add_unix_pid(credentials, _dbus_getpid()))
+ if (!_dbus_credentials_add_pid (credentials, _dbus_getpid()))
goto failed;
if (!_dbus_credentials_add_windows_sid (credentials,sid))
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index 6b58fda2..c483d764 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -1337,7 +1337,7 @@ _dbus_transport_get_unix_process_id (DBusTransport *transport,
if (_dbus_credentials_include (auth_identity,
DBUS_CREDENTIAL_UNIX_PROCESS_ID))
{
- *pid = _dbus_credentials_get_unix_pid (auth_identity);
+ *pid = _dbus_credentials_get_pid (auth_identity);
return TRUE;
}
else