From 6494b68742b5f20e3d431716a115319d666752ea Mon Sep 17 00:00:00 2001 From: gotmor Date: Mon, 4 Jun 2007 09:37:25 +0000 Subject: intendation fixes git-svn-id: http://dzen.googlecode.com/svn/trunk@63 f2baff5b-bf2c-0410-a398-912abdc3d8b2 --- util.c | 68 +++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index d584a4a..c2f44e2 100644 --- a/util.c +++ b/util.c @@ -1,7 +1,7 @@ /* (C)opyright MMVI-MMVII Anselm R. Garbe - * (C)opyright MMVII Robert Manea - * See LICENSE file for license details. - */ +* (C)opyright MMVII Robert Manea +* See LICENSE file for license details. +*/ #include "dzen.h" #include @@ -13,50 +13,50 @@ void * emalloc(unsigned int size) { - void *res = malloc(size); + void *res = malloc(size); - if(!res) - eprint("fatal: could not malloc() %u bytes\n", size); - return res; + if(!res) + eprint("fatal: could not malloc() %u bytes\n", size); + return res; } void eprint(const char *errstr, ...) { - va_list ap; + va_list ap; - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(EXIT_FAILURE); + va_start(ap, errstr); + vfprintf(stderr, errstr, ap); + va_end(ap); + exit(EXIT_FAILURE); } char * estrdup(const char *str) { - void *res = strdup(str); + void *res = strdup(str); - if(!res) - eprint("fatal: could not malloc() %u bytes\n", strlen(str)); - return res; + if(!res) + eprint("fatal: could not malloc() %u bytes\n", strlen(str)); + return res; } void spawn(const char *arg) { - static char *shell = NULL; - - if(!shell && !(shell = getenv("SHELL"))) - shell = "/bin/sh"; - if(!arg) - return; - /* The double-fork construct avoids zombie processes and keeps the code - * clean from stupid signal handlers. */ - if(fork() == 0) { - if(fork() == 0) { - setsid(); - execl(shell, shell, "-c", arg, (char *)NULL); - fprintf(stderr, "dzen: execl '%s -c %s'", shell, arg); - perror(" failed"); - } - exit(0); - } - wait(0); + static char *shell = NULL; + + if(!shell && !(shell = getenv("SHELL"))) + shell = "/bin/sh"; + if(!arg) + return; + /* The double-fork construct avoids zombie processes and keeps the code + * clean from stupid signal handlers. */ + if(fork() == 0) { + if(fork() == 0) { + setsid(); + execl(shell, shell, "-c", arg, (char *)NULL); + fprintf(stderr, "dzen: execl '%s -c %s'", shell, arg); + perror(" failed"); + } + exit(0); + } + wait(0); } -- cgit v1.2.3-54-g00ecf