metadata: clean up code, and remove invalid comment
authorDaniel Mack <daniel@zonque.org>
Tue, 7 Oct 2014 15:39:47 +0000 (17:39 +0200)
committerDaniel Mack <daniel@zonque.org>
Wed, 8 Oct 2014 15:11:11 +0000 (17:11 +0200)
Signed-off-by: Daniel Mack <daniel@zonque.org>
metadata.c

index 487a260cde89e8ba64fbdc52ab7b8bc14fb3b53f..17f6b61ead447f43a97a8de95abfcdf446123eab 100644 (file)
@@ -198,17 +198,13 @@ static int kdbus_meta_append_timestamp(struct kdbus_meta *meta,
 
 static int kdbus_meta_append_cred(struct kdbus_meta *meta)
 {
-       struct kdbus_creds creds = {};
-
-       /*
-        * uid, gid, pid and tid will be patched over again at message
-        * install time.
-        */
-       creds.uid = from_kuid_munged(current_user_ns(), current_uid());
-       creds.gid = from_kgid_munged(current_user_ns(), current_gid());
-       creds.pid = task_pid_vnr(current);
-       creds.tid = task_tgid_vnr(current);
-       creds.starttime = current->start_time;
+       struct kdbus_creds creds = {
+               .uid = from_kuid_munged(current_user_ns(), current_uid()),
+               .gid = from_kgid_munged(current_user_ns(), current_gid()),
+               .pid = task_pid_vnr(current),
+               .tid = task_tgid_vnr(current),
+               .starttime = current->start_time,
+       };
 
        return kdbus_meta_append_data(meta, KDBUS_ITEM_CREDS,
                                      &creds, sizeof(creds));