2 * Copyright (C) 1995-1999 Jeffrey A. Uphoff
3 * Modified by Olaf Kirch, 1996.
4 * Modified by H.J. Lu, 1998.
21 * Error-checking malloc() wrapper.
29 return ((void *)NULL);
31 if (!(ptr = malloc (size)))
32 /* SHIT! SHIT! SHIT! */
33 die ("malloc failed");
40 * Error-checking strdup() wrapper.
43 xstrdup (const char *string)
47 /* Will only fail if underlying malloc() fails (ENOMEM). */
48 if (!(result = strdup (string)))
49 die ("strdup failed");
59 xunlink (char *path, char *host)
63 tozap = malloc(strlen(path)+strlen(host)+2);
65 note(N_ERROR, "xunlink: malloc failed: errno %d (%s)",
66 errno, strerror(errno));
69 sprintf (tozap, "%s/%s", path, host);
71 if (unlink (tozap) == -1)
72 note(N_ERROR, "unlink (%s): %s", tozap, strerror (errno));
74 dprintf (N_DEBUG, "Unlinked %s", tozap);