Skip to content

Commit

Permalink
[dbus] Use UID_UNKNOWN
Browse files Browse the repository at this point in the history
Define PID_UNKNOWN too while at it.

Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
  • Loading branch information
Tomin1 committed Jun 3, 2020
1 parent dd8e7c5 commit bc813a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/usb_moded-dbus.c
Expand Up @@ -57,6 +57,8 @@
#define INIT_DONE_SIGNAL "init_done"
#define INIT_DONE_MATCH "type='signal',interface='"INIT_DONE_INTERFACE"',member='"INIT_DONE_SIGNAL"'"

# define PID_UNKNOWN ((pid_t)-1)

/* ========================================================================= *
* Prototypes
* ========================================================================= */
Expand Down Expand Up @@ -1396,14 +1398,14 @@ gboolean umdbus_get_name_owner_async(const char *name,
* Get uid of sender from D-Bus. This makes a synchronous D-Bus call
*
* @param name Name of sender from DBusMessage
* @return Uid of the sender
* @return Uid of the sender or UID_UNKNOWN if it can not be determined
*/
uid_t umdbus_get_sender_uid(const char *name)
{
LOG_REGISTER_CONTEXT;

pid_t pid = (pid_t)-1;
uid_t uid = (uid_t)-1;
pid_t pid = PID_UNKNOWN;
uid_t uid = UID_UNKNOWN;
DBusMessage *req = 0;
DBusMessage *rsp = 0;
DBusError err = DBUS_ERROR_INIT;
Expand Down

0 comments on commit bc813a6

Please sign in to comment.