]> xenbits.xensource.com Git - libvirt.git/commitdiff
BSD: Ensure process creation timestamp is init'd
authorDoug Goldstein <cardoe@cardoe.com>
Sat, 21 Sep 2013 16:02:08 +0000 (11:02 -0500)
committerDoug Goldstein <cardoe@cardoe.com>
Fri, 27 Sep 2013 16:16:35 +0000 (11:16 -0500)
While BSDs don't support process creation timestamp information via
PEERCRED for Unix sockets, we need to actually initialize the value
because it is used by the libvirt code.

src/rpc/virnetsocket.c

index 49c6ddc6faadc1a127956677a479b198b6aaefcb..152c5fcdfcd5804e76ff3e29fadc660f61e2b939 100644 (file)
@@ -1153,7 +1153,7 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
                                 uid_t *uid,
                                 gid_t *gid,
                                 pid_t *pid,
-                                unsigned long long *timestamp ATTRIBUTE_UNUSED)
+                                unsigned long long *timestamp)
 {
     struct xucred cr;
     socklen_t cr_len = sizeof(cr);
@@ -1178,7 +1178,9 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
         return -1;
     }
 
+    /* PID and process creation time are not supported on BSDs */
     *pid = -1;
+    *timestamp = -1;
     *uid = cr.cr_uid;
     *gid = cr.cr_gid;