OLD | NEW |
1 /* Taken from util-linux source. GPLv2. | 1 /* Taken from util-linux source. GPLv2. |
2 * Emits the current rootfs device. | 2 * Emits the current rootfs device. |
3 * Works by searching /dev recursively for a BLK device with the same device | 3 * Works by searching /dev recursively for a BLK device with the same device |
4 * number as '/'. | 4 * number as '/'. |
5 */ | 5 */ |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <err.h> | 8 #include <err.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <dirent.h> | 10 #include <dirent.h> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 if (!find_dev_recursive(name, s.st_dev)) { | 61 if (!find_dev_recursive(name, s.st_dev)) { |
62 fprintf(stderr, "unable to find match\n"); | 62 fprintf(stderr, "unable to find match\n"); |
63 return 1; | 63 return 1; |
64 } | 64 } |
65 | 65 |
66 printf("%s\n", name); | 66 printf("%s\n", name); |
67 | 67 |
68 return 0; | 68 return 0; |
69 } | 69 } |
OLD | NEW |