summaryrefslogtreecommitdiffstats
path: root/skdump.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-29 17:47:46 +0200
committerLennart Poettering <lennart@poettering.net>2008-06-29 17:47:46 +0200
commitd2f23cff093e231af63ba841d9e9a522b7f4b332 (patch)
tree624476c2e7f0b3e97977af74a39278f7194fe94c /skdump.c
parent705f7c9b9e48d2dd0d8a406e783eb972f56d3ce3 (diff)
make things a proper library
Diffstat (limited to 'skdump.c')
-rw-r--r--skdump.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/skdump.c b/skdump.c
new file mode 100644
index 0000000..6fa9167
--- /dev/null
+++ b/skdump.c
@@ -0,0 +1,23 @@
+#include <string.h>
+#include <errno.h>
+
+#include "smart.h"
+
+int main(int argc, char *argv[]) {
+ int ret;
+ const char *device;
+ SkDevice *d;
+
+ device = argc >= 2 ? argv[1] : "/dev/sda";
+
+ if ((ret = sk_disk_open(device, &d)) < 0) {
+ g_printerr("Failed to open disk %s: %s\n", device, strerror(errno));
+ return 1;
+ }
+
+ sk_disk_dump(d);
+
+ sk_disk_free(d);
+
+ return 0;
+}