]> sourceware.org Git - dm.git/commitdiff
Call dm_lib_exit() and dm_lib_release() automatically now.
authorAlasdair Kergon <agk@redhat.com>
Mon, 16 May 2005 15:15:32 +0000 (15:15 +0000)
committerAlasdair Kergon <agk@redhat.com>
Mon, 16 May 2005 15:15:32 +0000 (15:15 +0000)
WHATS_NEW
dmsetup/dmsetup.c
lib/ioctl/libdm-iface.c
lib/libdevmapper.h

index 7e900e4294f4e2fe7cef8783bc716971cc6596e5..6fa4bec9c4dbf2706b6a103a87c9076278a33eec 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 1.01.02 - 
 =============================
+  Call dm_lib_exit() and dm_lib_release() automatically now.
   Add --target <target_type> filter to dmsetup table/status.
   Fix dmsetup getopt_long usage.
 
index f38c1d80431bee3b2260e5dd41998ac674c52e94..19a53f875f5daafcd3001165eabe7e3c9c57cba8 100644 (file)
@@ -1073,8 +1073,5 @@ int main(int argc, char **argv)
                exit(1);
        }
 
-       dm_lib_release();
-       dm_lib_exit();
-
        return 0;
 }
index 27ba1f4dc7c1c7cd47ec9b8cba6ee186705e07e7..471ca851a1c2bbdb1428ec9181a000f594fefe85 100644 (file)
@@ -117,6 +117,7 @@ static void *_align(void *ptr, unsigned int a)
        return (void *) (((unsigned long) ptr + agn) & ~agn);
 }
 
+#ifdef DM_IOCTLS
 static int _get_proc_number(const char *file, const char *name,
                            uint32_t *number)
 {
@@ -226,6 +227,7 @@ static int _create_control(const char *control, uint32_t major, uint32_t minor)
 
        return 1;
 }
+#endif
 
 static int _open_control(void)
 {
@@ -1396,10 +1398,7 @@ void dm_lib_release(void)
 
 void dm_lib_exit(void)
 {
-       if (_control_fd != -1) {
-               close(_control_fd);
-               _control_fd = -1;
-       }
+       dm_lib_release();
        _version_ok = 1;
        _version_checked = 0;
 }
index 8cab2d94c8ec42a93e27fd7112685ab8577aae3f..44be174af5968bab88963364fadfe2006cea97c5 100644 (file)
@@ -166,6 +166,6 @@ const char *dm_dir(void);
 
 /* Release library resources */
 void dm_lib_release(void);
-void dm_lib_exit(void);
+void dm_lib_exit(void) __attribute((destructor));
 
 #endif                         /* LIB_DEVICE_MAPPER_H */
This page took 0.040128 seconds and 5 git commands to generate.