ChangeLog, Makefile.in, base_device.c, base_device.tst, fsck.c, fsck.h:
  fsck.c (device_already_active): Change to use new version of
  	base_device() which now returns dynamically allocated memory.
  base_device.c (base_device): New version moved from fsck.c which now
  	understands ugly devfs names.  (Debian bug #65181)
  base_device.tst: Test case for base_device.c

diff --git a/misc/Makefile.in b/misc/Makefile.in
index a4d0e44..e9897a3 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -29,7 +29,7 @@
 BADBLOCKS_OBJS=	badblocks.o
 E2LABEL_OBJS=	e2label.o
 E2IMAGE_OBJS=	e2image.o
-FSCK_OBJS=	fsck.o get_device_by_label.o
+FSCK_OBJS=	fsck.o get_device_by_label.o base_device.o
 
 SRCS=	$(srcdir)/tune2fs.c $(srcdir)/mklost+found.c $(srcdir)/mke2fs.c \
 		$(srcdir)/chattr.c $(srcdir)/lsattr.c $(srcdir)/dumpe2fs.c \
@@ -61,6 +61,13 @@
 e2image: $(E2IMAGE_OBJS) $(DEPLIBS)
 	$(CC) $(ALL_LDFLAGS) -o e2image $(E2IMAGE_OBJS) $(LIBS)
 
+base_device: base_device.c
+	$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $< -DDEBUG -o $@
+
+check:: base_device
+	./base_device < $(srcdir)/base_device.tst > base_device.out
+	cmp $(srcdir)/base_device.tst base_device.out
+
 mklost+found: $(MKLPF_OBJS)
 	$(CC) $(ALL_LDFLAGS) -o mklost+found $(MKLPF_OBJS)
 
@@ -169,7 +176,8 @@
 
 clean:
 	$(RM) -f $(SPROGS) $(USPROGS) $(UPROGS) $(UMANPAGES) $(SMANPAGES) \
-		mke2fs.static \#* *.s *.o *.a *~ core
+		base_device base_device.out mke2fs.static \
+		\#* *.s *.o *.a *~ core 
 
 mostlyclean: clean
 distclean: clean