-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include "wm.h"
-
-void
-error(const char *errstr, ...) {
- va_list ap;
- va_start(ap, errstr);
- vfprintf(stderr, errstr, ap);
- va_end(ap);
- exit(1);
-}
-
-static void
-bad_malloc(unsigned int size)
-{
- fprintf(stderr, "fatal: could not malloc() %d bytes\n",
- (int) size);
- exit(1);
-}
-
-void *
-emallocz(unsigned int size)
-{
- void *res = calloc(1, size);
- if(!res)
- bad_malloc(size);
- return res;
-}