Make oslib/linux-dev-lookup.c a stand-alone library
authorTomohiro Kusumi <tkusumi@tuxera.com>
Fri, 14 Apr 2017 21:06:26 +0000 (00:06 +0300)
committerJens Axboe <axboe@fb.com>
Wed, 26 Apr 2017 18:43:10 +0000 (12:43 -0600)
It needs to include linux-dev-lookup.h from local directory where
linux-dev-lookup.c is also located, to be able to use this as
a stand-alone library, which is useful for debugging purpose.
In fact, most of the files under oslib/ directory do things this way.

It also doesn't need to include os/os.h as it has no dependency.

--
 # cat ./test10.c
 #include <stdio.h>
 #include "oslib/linux-dev-lookup.h"
 int main(void) {
         /* just to see if it compiles */
         blktrace_lookup_device(NULL, NULL, 0, 0);
         return 0;
 }
 # gcc -Wall -g ./test10.c oslib/linux-dev-lookup.c

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
oslib/linux-dev-lookup.c

index 2bbd14a070739c28a74e0be30d0723cbbb7eb589..5fbccd33c6d541ea168d4025d3eb5b742a3514dc 100644 (file)
@@ -5,8 +5,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
 #include <stdio.h>
 #include <unistd.h>
 
-#include "../os/os.h"
-#include "oslib/linux-dev-lookup.h"
+#include "linux-dev-lookup.h"
 
 int blktrace_lookup_device(const char *redirect, char *path, unsigned int maj,
                           unsigned int min)
 
 int blktrace_lookup_device(const char *redirect, char *path, unsigned int maj,
                           unsigned int min)