From 2fbc46a92318904f1414f1aeaf256970e80e845a Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Wed, 2 Jun 2010 20:09:47 +0000 Subject: [PATCH] whitespace cleanups git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2887 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- lib_internal/matchlist-initrefserverlist.c | 12 ++++++------ src/testsuite/hashcalc-plain.c | 20 ++++++++++---------- src/vcontext.c | 30 +++++++++++++++--------------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lib_internal/matchlist-initrefserverlist.c b/lib_internal/matchlist-initrefserverlist.c index 5ed9997..f777ce8 100644 --- a/lib_internal/matchlist-initrefserverlist.c +++ b/lib_internal/matchlist-initrefserverlist.c @@ -1,16 +1,16 @@ // $Id$ --*- c -*-- // Copyright (C) 2004 Enrico Scholz -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; version 2 of the License. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -45,7 +45,7 @@ MatchList_initRefserverList(struct MatchList **lst, size_t *cnt, int cur_dir = Eopen(".", O_RDONLY, 0); struct dirent **entries; int count,i; - + Echdir(dir); count = scandir(".", &entries, selectRefserver, alphasort); if (count==-1) { @@ -61,7 +61,7 @@ MatchList_initRefserverList(struct MatchList **lst, size_t *cnt, *lst = Emalloc(sizeof(struct MatchList) * count); *cnt = count; for (i=0; id_name; + char const *tmp = entries[i]->d_name; size_t l = strlen(tmp); char vname[sizeof("./") + l]; struct MatchVserverInfo vserver = { @@ -71,7 +71,7 @@ MatchList_initRefserverList(struct MatchList **lst, size_t *cnt, memcpy(vname, "./", 2); memcpy(vname+2, tmp, l+1); - + if (!MatchVserverInfo_init(&vserver)) { WRITE_MSG(2, "failed to initialize unification of reference vserver\n"); exit(1); diff --git a/src/testsuite/hashcalc-plain.c b/src/testsuite/hashcalc-plain.c index b8dc8c6..a444f3d 100644 --- a/src/testsuite/hashcalc-plain.c +++ b/src/testsuite/hashcalc-plain.c @@ -1,16 +1,16 @@ // $Id$ --*- c -*-- // Copyright (C) 2006 Enrico Scholz -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; version 2 of the License. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -36,19 +36,19 @@ convertDigest(char res[], ensc_hash_context * h_ctx) { static char const HEX_DIGIT[] = "0123456789abcdef"; size_t d_size = ensc_crypto_hashctx_get_digestsize(h_ctx); - + unsigned char digest[d_size]; size_t out = 0; if (ensc_crypto_hashctx_get_digest(h_ctx, digest, NULL, d_size)==-1) return false; - + for (size_t in=0; in> 4]; res[out++] = HEX_DIGIT[digest[in] & 0x0f]; } res[out++] = '\0'; - + return true; } @@ -81,13 +81,13 @@ int main(int UNUSED argc, char *argv[]) assert(ensc_crypto_hashctx_update(&hash_context, buf, buf_size)!=-1); munmap((void *)(buf), buf_size); } - + assert(convertDigest(digest, &hash_context)); - + Vwrite(1, digest, strlen(digest)); Vwrite(1, "\n", 1); - + ensc_crypto_hashctx_free(&hash_context); - + return 0; } diff --git a/src/vcontext.c b/src/vcontext.c index fd2f59f..57a45fe 100644 --- a/src/vcontext.c +++ b/src/vcontext.c @@ -1,16 +1,16 @@ // $Id$ --*- c -*-- // Copyright (C) 2004-2006 Enrico Scholz -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; version 2 of the License. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -99,9 +99,9 @@ CMDLINE_OPTIONS[] = { { "personality-flags", required_argument, 0, CMD_PERSFLAG }, { "vlogin", no_argument, 0, CMD_VLOGIN }, { "pivot-root", no_argument, 0, CMD_PIVOT_ROOT }, -#if 1 +#if 1 { "fakeinit", no_argument, 0, CMD_INITPID }, // compatibility -#endif +#endif { 0,0,0,0 }, }; @@ -205,7 +205,7 @@ connectExternalSync(char const *filename) { int fd; struct sockaddr_un addr; - + if (filename==0) return -1; ENSC_INIT_UNIX_SOCK(addr, filename); @@ -237,7 +237,7 @@ static void doExternalSync(int fd, char const *msg) { char c; - + if (fd==-1) return; if (msg) EsendAll(fd, msg, strlen(msg)); @@ -256,13 +256,13 @@ doit(struct Arguments const *args, int argc, char *argv[]) { int p[2][2]; pid_t pid = initSync(p, args->do_disconnect); - + if (pid==0) { xid_t xid; int ext_sync_fd = connectExternalSync(args->sync_sock); - doSyncStage0(p, args->do_disconnect); - + doSyncStage0(p, args->do_disconnect); + if (args->do_create) { xid = vc_ctx_create(args->xid, NULL); if (xid==VC_NOCTX) { @@ -378,7 +378,7 @@ doit(struct Arguments const *args, int argc, char *argv[]) } assert(args->do_disconnect); - + waitOnSync(pid, p, args->xid!=VC_DYNAMIC_XID && args->do_migrate); return EXIT_SUCCESS; } @@ -430,11 +430,11 @@ int main (int argc, char *argv[]) .personality_flags = 0, .sync_msg = "ok", }; - + while (1) { int c = getopt_long(argc, argv, "+", CMDLINE_OPTIONS, 0); if (c==-1) break; - + switch (c) { case CMD_HELP : showHelp(1, argv[0], 0); case CMD_VERSION : showVersion(); @@ -474,10 +474,10 @@ int main (int argc, char *argv[]) } signal(SIGCHLD, SIG_DFL); - + if (args.do_migrateself) args.xid = Evc_get_task_xid(0); - + if (!args.do_create && !args.do_migrate) WRITE_MSG(2, "Neither '--create' nor '--migrate' specified; try '--help' for more information\n"); else if (args.do_create && args.do_migrate) -- 1.8.1.5