Code style -- for loop iterative variables initial declaration
by Petr Cech
Hi everyone,
I would like to ask you what you think about the initialization of
iterative variables in forloops. I know that present code style does not
allow it. But how I recognized, we use C99, and this feature is here now.
(example)
Instead of:|
|||# inti;
# for(i =0;...)|||
we could write:
||# for(inti =0;...)|
I see an advantage in limiting the validity of such variables. That
means higher code readability. Disadvantages I searched but did not find.
Regards
Petr
8 years, 7 months
[PATCH] Two sbus fixes
by Jakub Hrozek
Hi,
I found two issues in the sbus code while testing the by-certificate
lookups. One was that if parsing the reply with client UID failed, then
errno would have been garbage.
The second is that since we added signal handling, we always receive
NameOwnerChanged after someone binds to the bus. But NameOwnerChanged
sender is the bus itself, which doesn't reveal the sender ID -- the
request to find the sender ID failed and we didn't process the signal at
all.
The only related discussion I found was:
http://permalink.gmane.org/gmane.comp.freedesktop.dbus/7404
which would indicate that for the bus itself, the UID can't be
retrieved. So I modified the request that reads the UID to return a
special error in this case and lets the caller handle it -- for signals,
we proceed, but for messages, we don't because we can't check the UID
against the ACL.
8 years, 7 months