aewl
changeset 92:4bee0aa5b286
using EXIT_stuff in exit() now
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Tue, 18 Jul 2006 08:18:54 +0200 |
parents | c4f8d7695833 |
children | c498da7520c7 |
files | main.c util.c |
diffstat | 2 files changed, 7 insertions(+), 8 deletions(-) [+] |
line diff
1.1 --- a/main.c Mon Jul 17 18:49:13 2006 +0200 1.2 +++ b/main.c Tue Jul 18 08:18:54 2006 +0200 1.3 @@ -179,14 +179,13 @@ 1.4 1.5 for(i = 1; (i < argc) && (argv[i][0] == '-'); i++) { 1.6 switch (argv[i][1]) { 1.7 - case 'v': 1.8 - fprintf(stdout, "%s", 1.9 - "dwm-"VERSION", (C)opyright MMVI Anselm R. Garbe\n"); 1.10 - exit(0); 1.11 - break; 1.12 default: 1.13 eprint("usage: dwm [-v]\n"); 1.14 break; 1.15 + case 'v': 1.16 + fputs("dwm-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout); 1.17 + exit(EXIT_SUCCESS); 1.18 + break; 1.19 } 1.20 } 1.21
2.1 --- a/util.c Mon Jul 17 18:49:13 2006 +0200 2.2 +++ b/util.c Tue Jul 18 08:18:54 2006 +0200 2.3 @@ -17,7 +17,7 @@ 2.4 { 2.5 fprintf(stderr, "fatal: could not malloc() %d bytes\n", 2.6 (int) size); 2.7 - exit(1); 2.8 + exit(EXIT_FAILURE); 2.9 } 2.10 2.11 /* extern */ 2.12 @@ -37,7 +37,7 @@ 2.13 va_start(ap, errstr); 2.14 vfprintf(stderr, errstr, ap); 2.15 va_end(ap); 2.16 - exit(1); 2.17 + exit(EXIT_FAILURE); 2.18 } 2.19 2.20 void 2.21 @@ -55,7 +55,7 @@ 2.22 fprintf(stderr, "dwm: execvp %s", argv[0]); 2.23 perror(" failed"); 2.24 } 2.25 - exit (0); 2.26 + exit(EXIT_FAILURE); 2.27 } 2.28 wait(0); 2.29 }