]> err.no Git - util-linux/commitdiff
libblkid: use blkid_new_probe_from_filename() in docs
authorKarel Zak <kzak@redhat.com>
Tue, 29 Sep 2009 19:58:52 +0000 (21:58 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 29 Sep 2009 19:58:52 +0000 (21:58 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/partitions/partitions.c

index c1c39164cbf04cc6d01e0b76da572ff9457438cc..aa70df638ab993bf94d4104b991cefb5fefdabee 100644 (file)
  * <informalexample>
  *  <programlisting>
  * blkid_probe pr;
- * int fd;
  * const char *ptname;
  *
- * fd = open(devname, O_RDONLY);
- * pr = blkid_new_probe();
- * blkid_probe_set_device(pr, fd, 0, 0);
+ * pr = blkid_new_probe_from_filename(devname);
+ * if (!pr)
+ *     err("%s: faild to open device", devname);
  *
  * blkid_probe_enable_partitions(pr, TRUE);
  * blkid_do_fullprobe(pr);
@@ -52,7 +51,6 @@
  * printf("%s partition type detected\n", pttype);
  *
  * blkid_free_probe(pr);
- * close(fd);
  *
  * // don't forget to check return codes in your code!
  *  </programlisting>
  * blkid_probe pr;
  * blkid_partlist ls;
  * int nparts, i;
- * int fd;
  *
- * fd = open(devname, O_RDONLY);
- * pr = blkid_new_probe();
- * blkid_probe_set_device(pr, fd, 0, 0);
+ * pr = blkid_new_probe_from_filename(devname);
+ * if (!pr)
+ *     err("%s: faild to open device", devname);
  *
  * ls = blkid_probe_get_partitions(pr);
  * nparts = blkid_partlist_numof_partitions(ls);
@@ -84,7 +81,6 @@
  * }
  *
  * blkid_free_probe(pr);
- * close(fd);
  *
  * // don't forget to check return codes in your code!
  *  </programlisting>