util.c
changeset 138 c1185dc7a36e
parent 123 61490330e90a
child 164 21071ae1fe68
equal deleted inserted replaced
137:77922a389fa8 138:c1185dc7a36e
    13 /* static */
    13 /* static */
    14 
    14 
    15 static void
    15 static void
    16 bad_malloc(unsigned int size)
    16 bad_malloc(unsigned int size)
    17 {
    17 {
    18 	fprintf(stderr, "fatal: could not malloc() %d bytes\n",
    18 	eprint("fatal: could not malloc() %u bytes\n", size);
    19 			(int) size);
       
    20 	exit(EXIT_FAILURE);
       
    21 }
    19 }
    22 
    20 
    23 /* extern */
    21 /* extern */
    24 
    22 
    25 void *
    23 void *
    56 			setsid();
    54 			setsid();
    57 			execvp(argv[0], argv);
    55 			execvp(argv[0], argv);
    58 			fprintf(stderr, "dwm: execvp %s", argv[0]);
    56 			fprintf(stderr, "dwm: execvp %s", argv[0]);
    59 			perror(" failed");
    57 			perror(" failed");
    60 		}
    58 		}
    61 		exit(EXIT_FAILURE);
    59 		exit(0);
    62 	}
    60 	}
    63 	wait(0);
    61 	wait(0);
    64 }
    62 }