Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Sep 24, 2015
1 parent 62eb28c commit 47d8dac
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions neverbleed.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ static void warnvf(const char *fmt, va_list args)
fputc('\n', stderr);
}

__attribute__((format(printf, 1, 2)))
static void warnf(const char *fmt, ...)
__attribute__((format(printf, 1, 2))) static void warnf(const char *fmt, ...)
{
va_list args;

Expand All @@ -87,8 +86,7 @@ static void warnf(const char *fmt, ...)
va_end(args);
}

__attribute__((format(printf, 1, 2), noreturn))
static void dief(const char *fmt, ...)
__attribute__((format(printf, 1, 2), noreturn)) static void dief(const char *fmt, ...)
{
va_list args;

Expand Down Expand Up @@ -682,8 +680,7 @@ static int setuidgid_stub(struct expbuf_t *buf)
return 0;
}

__attribute__((noreturn))
static void *daemon_close_notify_thread(void *_close_notify_fd)
__attribute__((noreturn)) static void *daemon_close_notify_thread(void *_close_notify_fd)
{
int close_notify_fd = (int)((char *)_close_notify_fd - (char *)NULL);
char b;
Expand Down Expand Up @@ -760,8 +757,7 @@ static void *daemon_conn_thread(void *_sock_fd)
return NULL;
}

__attribute__((noreturn))
static void daemon_main(int listen_fd, int close_notify_fd, const char *tempdir)
__attribute__((noreturn)) static void daemon_main(int listen_fd, int close_notify_fd, const char *tempdir)
{
pthread_t tid;
pthread_attr_t thattr;
Expand Down Expand Up @@ -791,20 +787,20 @@ static void daemon_main(int listen_fd, int close_notify_fd, const char *tempdir)
}

static RSA_METHOD rsa_method = {
"privsep RSA method",
NULL, /* rsa_pub_enc */
NULL, /* rsa_pub_dec */
priv_enc_proxy, /* rsa_priv_enc */
priv_dec_proxy, /* rsa_priv_dec */
NULL, /* rsa_mod_exp */
NULL, /* bn_mod_exp */
NULL, /* init */
NULL, /* finish */
RSA_FLAG_SIGN_VER, /* flags */
NULL, /* app data */
sign_proxy, /* rsa_sign */
NULL, /* rsa_verify */
NULL /* rsa_keygen */
"privsep RSA method", /* name */
NULL, /* rsa_pub_enc */
NULL, /* rsa_pub_dec */
priv_enc_proxy, /* rsa_priv_enc */
priv_dec_proxy, /* rsa_priv_dec */
NULL, /* rsa_mod_exp */
NULL, /* bn_mod_exp */
NULL, /* init */
NULL, /* finish */
RSA_FLAG_SIGN_VER, /* flags */
NULL, /* app data */
sign_proxy, /* rsa_sign */
NULL, /* rsa_verify */
NULL /* rsa_keygen */
};

int neverbleed_init(neverbleed_t *nb, char *errbuf)
Expand Down Expand Up @@ -868,10 +864,8 @@ int neverbleed_init(neverbleed_t *nb, char *errbuf)
pipe_fds[0] = -1;

/* setup engine */
if ((nb->engine = ENGINE_new()) == NULL ||
!ENGINE_set_id(nb->engine, "neverbleed") ||
!ENGINE_set_name(nb->engine, "privilege separation software engine") ||
!ENGINE_set_RSA(nb->engine, &rsa_method)) {
if ((nb->engine = ENGINE_new()) == NULL || !ENGINE_set_id(nb->engine, "neverbleed") ||
!ENGINE_set_name(nb->engine, "privilege separation software engine") || !ENGINE_set_RSA(nb->engine, &rsa_method)) {
snprintf(errbuf, NEVERBLEED_ERRBUF_SIZE, "failed to initialize the OpenSSL engine");
goto Fail;
}
Expand Down

0 comments on commit 47d8dac

Please sign in to comment.