{
void *ret = malloc(size);
if (!ret && size)
- err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
+ xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
return ret;
}
{
void *ret = realloc(ptr, size);
if (!ret && size)
- err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
+ xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
return ret;
}
{
void *ret = calloc(nelems, size);
if (!ret && size && nelems)
- err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
+ xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
return ret;
}
return NULL;
ret = strdup(str);
if (!ret)
- err(XALLOC_EXIT_CODE, "cannot duplicate string");
+ xerrx(XALLOC_EXIT_CODE, "cannot duplicate string");
return ret;
}
#include <stdio.h>
#include <stdlib.h>
#include "sig.h"
+#include "c.h"
/* Linux signals:
*
copy = strdup(s);
if (!copy)
- err(EXIT_FAILURE, "cannot duplicate string");
+ xerrx(EXIT_FAILURE, "cannot duplicate string");
for (p = copy; *p != '\0'; p++)
*p = toupper(*p);
p = copy;
char buf[10 + strlen(argv[i]) + 1];
if (check_pid_argument(argv[i]))
- errx(EXIT_FAILURE, _("invalid process id: %s"),
+ xerrx(EXIT_FAILURE, _("invalid process id: %s"),
argv[i]);
/*
* At this point, all arguments are in the form
if (fd == -1) {
/* process exited maybe */
if (run_time->warnings)
- warn(_("cannot open file %s"), buf);
+ xwarn(_("cannot open file %s"), buf);
return;
}
fstat(fd, &statbuf);