+void clean_allocs(void)
+{
+ clean_files();
+ clean_bufs();
+}
+
+char *make_dev_hdr(char *pad, size_t len, struct d_info *dip, int add_parens)
+{
+ if (dip->devmap)
+ snprintf(pad, len, "%s", dip->devmap);
+ else if (add_parens)
+ snprintf(pad, len, "(%3d,%3d)",
+ MAJOR(dip->device), MINOR(dip->device));
+ else
+ snprintf(pad, len, "%d,%d",
+ MAJOR(dip->device), MINOR(dip->device));
+
+ return pad;
+}
+
+char *mkhandle(struct d_info *dip, char *str, size_t len)
+{
+ return make_dev_hdr(str, len, dip, 0);
+}
+
+FILE *my_fopen(const char *path, const char *mode)
+{
+ FILE *fp;
+
+ do {
+ fp = fopen(path, mode);
+ } while (fp == NULL && handle_open_failure());
+
+ return fp;
+}
+
+int my_open(const char *path, int flags)
+{
+ int fd;
+
+ do {
+ fd = open(path, flags);
+ } while (fd < 0 && handle_open_failure());
+
+ return fd;