From: Karel Zak <kzak@redhat.com>
To: Rainer Gerhards <rgerhards@gmail.com>
Cc: Sami Kerola <kerolasa@iki.fi>, util-linux@vger.kernel.org
Subject: Re: [PATCH 1/8] logger: tidy few indentation issues
Date: Mon, 16 Mar 2015 12:50:14 +0100 [thread overview]
Message-ID: <20150316115014.GK28925@ws.net.home> (raw)
In-Reply-To: <CAP-up9DHpM8Xye6y7LptG4bNUeW_Kx22R80Q6nAgv0v8kzi+VQ@mail.gmail.com>
On Mon, Mar 16, 2015 at 12:22:51PM +0100, Rainer Gerhards wrote:
> On Sun, Mar 15, 2015 at 1:54 PM, Sami Kerola <kerolasa@iki.fi> wrote:
>
> Quick question on this (especially for future work):
>
> > @@ -387,29 +386,35 @@ static void syslog_rfc3164_header(struct logger_ctl *const ctl)
> > #define NILVALUE "-"
> > static void syslog_rfc5424_header(struct logger_ctl *const ctl)
> > {
> > + char *time;
> > + char *hostname;
> > + char *const app_name = ctl->tag;
> > + char *procid;
> > + char *const msgid = xstrdup(ctl->msgid ? ctl->msgid : NILVALUE);
> > + char *structured_data;
>
> Is it project policy to always define variables at the beginning of
> the function? I ask because I used to do that as well, before I got
at beginning of the { block }, for example:
if (foo) {
char *foostr = strdup(whatever);
do_foo(foostr);
free(foostr);
}
is fine.
> Also on the idention: I assume indention via tabs with tabwidth 4. Is
> there a style document I an look at?
If possible (e.g. new/refactored stuff) then we usually follow kernel:
https://www.kernel.org/doc/Documentation/CodingStyle
... but there are many old utils where it's better to follow already
used codding style than mix more styles together.
> Thanks and sorry for the extra effort.
Ah, this is a real detail...
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2015-03-16 11:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-15 12:54 [PATCH 0/8] pull: logger: add tests and fix couple issues Sami Kerola
2015-03-15 12:54 ` [PATCH 1/8] logger: tidy few indentation issues Sami Kerola
2015-03-16 10:52 ` Karel Zak
2015-03-16 11:22 ` Rainer Gerhards
2015-03-16 11:50 ` Karel Zak [this message]
2015-03-15 12:54 ` [PATCH 2/8] logger: check xgethostname() return value Sami Kerola
2015-03-16 10:53 ` Karel Zak
2015-03-15 12:54 ` [PATCH 3/8] tests: add test_logger helper command Sami Kerola
2015-03-16 10:57 ` Karel Zak
2015-03-16 13:19 ` Karel Zak
2015-03-15 12:54 ` [PATCH 4/8] tests: add logger(1) command line options tests Sami Kerola
2015-03-15 12:54 ` [PATCH 5/8] logger: fix rfc5424 format crash Sami Kerola
2015-03-16 10:49 ` Karel Zak
2015-03-16 10:55 ` Rainer Gerhards
2015-03-16 11:13 ` Karel Zak
2015-03-16 10:57 ` Rainer Gerhards
2015-03-15 12:54 ` [PATCH 6/8] tests: add logger(1) message format tests Sami Kerola
2015-03-15 12:54 ` [PATCH 7/8] logger: use errx() when checking user input Sami Kerola
2015-03-16 10:54 ` Karel Zak
2015-03-15 12:54 ` [PATCH 8/8] tests: add logger(1) error condition tests Sami Kerola
2015-03-16 11:28 ` [PATCH 0/8] pull: logger: add tests and fix couple issues Rainer Gerhards
2015-03-16 12:06 ` Karel Zak
2015-03-16 23:55 ` Sami Kerola
2015-03-17 9:06 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150316115014.GK28925@ws.net.home \
--to=kzak@redhat.com \
--cc=kerolasa@iki.fi \
--cc=rgerhards@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox