<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.utilities.util-linux-ng">
    <title>gmane.linux.utilities.util-linux-ng</title>
    <link>http://blog.gmane.org/gmane.linux.utilities.util-linux-ng</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5886"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5885"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5881"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5877"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5860"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5859"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5848"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5847"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5846"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5845"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5844"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5843"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5839"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5833"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5827"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5811"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5804"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5803"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5801"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5798"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5886">
    <title>Portability patches for GNU/Hurd</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5886</link>
    <description>&lt;pre&gt;Hi!

The subject says is all.  :-)


Grüße,
 Thomas

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Thomas Schwinge</dc:creator>
    <dc:date>2012-05-25T18:13:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5885">
    <title>[PATCH] kill: Check the correct variable when configuring.</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5885</link>
    <description>&lt;pre&gt;Signed-off-by: Thomas Schwinge &amp;lt;thomas-qD8j1LwMmJjtCj0u4l0SBw&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index a1b1e9b..eb67ada 100644
--- a/configure.ac
+++ b/configure.ac
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -976,7 +976,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; AC_ARG_ENABLE([kill],
 )
 UL_BUILD_INIT([kill])
 UL_REQUIRES_LINUX([kill])
-AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes)
+AM_CONDITIONAL(BUILD_KILL, test "x$build_kill" = xyes)
 
 
 AC_ARG_ENABLE([last],
&lt;/pre&gt;</description>
    <dc:creator>Thomas Schwinge</dc:creator>
    <dc:date>2012-05-25T18:11:22</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5881">
    <title>[PULL] su</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5881</link>
    <description>&lt;pre&gt;Hi,

coreutils isn't really interested in maintaining su anymore.
Distributions have to add custom patches to fix bugs and add
features. The worst offender is probably the pam patch. Fortunately
we managed to sync the patch between openSUSE and Fedora meanwhile.
Over time the risk that the patches divert again increases though.
Since util-linux now contains a common login program it looks like a
good new home for su too.

To integrate su into util-linux I've extracted the history of the su
program until the last GPLv2 version (they've changed to GPLv3
meanwhile) from coreutils' git and merged it with util-linux.
Then I've added the patches used in Fedora and openSUSE and fixed the
files to actually build.

You can find the result in branch su-v1 (ff6b15d) at
git-9UaJU3cA/F/QT0dZR+AlfA&amp;lt; at &amp;gt;public.gmane.org:lnussel/util-linux.git

I've also filed a pull request on github:
https://github.com/karelzak/util-linux/pull/10

Originally I had planned to implement separate tty allocation for
the child program on top of that to get rid of the evil setsid
patch. It turned out to be more complicated than I thought though. The
change would be too massive to backport anyways I guess. So the next
step would be to rip out the non-pam legacy stuff and clean up the code
to make it readable again.

cu
Ludwig

&lt;/pre&gt;</description>
    <dc:creator>Ludwig Nussel</dc:creator>
    <dc:date>2012-05-24T12:58:01</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5877">
    <title>[PATCH 1/3] logger: avoid explicit fclose(stdout)</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5877</link>
    <description>&lt;pre&gt;This is done for us via an atexit hook since c05a80ca6385b8. Avoids a
useless 'Write error' on exit whenever invoking the tool.

Signed-off-by: Dave Reisner &amp;lt;dreisner-fd97jBR+K/6hPH1hqNUYSQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 misc-utils/logger.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index 067272a..19b4c47 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -248,8 +248,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; main(int argc, char **argv) {
 else
 LogSock = myopenlog(usock);
 
-(void) fclose(stdout);
&lt;/pre&gt;</description>
    <dc:creator>Dave Reisner</dc:creator>
    <dc:date>2012-05-23T20:35:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5860">
    <title>[PATCH] misc-utils: cleanup unused strings.h includes</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5860</link>
    <description>&lt;pre&gt;Noticed on klibc building.

Signed-off-by: maximilian attems &amp;lt;max-U9r9yeDMy7A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 misc-utils/kill.c   |    1 -
 misc-utils/logger.c |    1 -
 misc-utils/namei.c  |    1 -
 3 files changed, 3 deletions(-)

diff --git a/misc-utils/kill.c b/misc-utils/kill.c
index da7c8ab..c592f52 100644
--- a/misc-utils/kill.c
+++ b/misc-utils/kill.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -45,7 +45,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;stdio.h&amp;gt;
 #include &amp;lt;stdlib.h&amp;gt;
 #include &amp;lt;string.h&amp;gt;
-#include &amp;lt;strings.h&amp;gt;
 #include &amp;lt;ctype.h&amp;gt;/* for isdigit() */
 #include &amp;lt;unistd.h&amp;gt;
 #include &amp;lt;signal.h&amp;gt;
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index db3469c..9805a7d 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -43,7 +43,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;stdio.h&amp;gt;
 #include &amp;lt;ctype.h&amp;gt;
 #include &amp;lt;string.h&amp;gt;
-#include &amp;lt;strings.h&amp;gt;
 #include &amp;lt;sys/types.h&amp;gt;
 #include &amp;lt;sys/socket.h&amp;gt;
 #include &amp;lt;sys/un.h&amp;gt;
diff --git a/misc-utils/namei.c b/misc-utils/namei.c
index b15d4f7..fc1689d 100644
--- a/misc-utils/namei.c
+++ b/misc-utils/namei.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -24,7 +24,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;unistd.h&amp;gt;
 #include &amp;lt;getopt.h&amp;gt;
 #include &amp;lt;string.h&amp;gt;
-#include &amp;lt;strings.h&amp;gt;
 #include &amp;lt;stdlib.h&amp;gt;
 #include &amp;lt;errno.h&amp;gt;
 #include &amp;lt;sys/types.h&amp;gt;
&lt;/pre&gt;</description>
    <dc:creator>maximilian attems</dc:creator>
    <dc:date>2012-05-22T14:33:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5859">
    <title>[PATCH] include: [c.h] protect container_of</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5859</link>
    <description>&lt;pre&gt;fixes lots of warning noise:
../../../include/c.h:112:0: warning: "container_of" redefined [enabled
by default]
/usr/lib/klibc/include/stddef.h:52:0: note: this is the location of the
previous definition

Signed-off-by: maximilian attems &amp;lt;max-U9r9yeDMy7A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 include/c.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/c.h b/include/c.h
index b6d8ced..8c8db73 100644
--- a/include/c.h
+++ b/include/c.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -109,9 +109,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #define offsetof(TYPE, MEMBER) ((size_t) &amp;amp;((TYPE *)0)-&amp;gt;MEMBER)
 #endif
 
+#ifndef container_of
 #define container_of(ptr, type, member) ({                       \
 const __typeof__( ((type *)0)-&amp;gt;member ) *__mptr = (ptr); \
 (type *)( (char *)__mptr - offsetof(type,member) );})
+#endif
 
 #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
 # ifdef HAVE___PROGNAME
&lt;/pre&gt;</description>
    <dc:creator>maximilian attems</dc:creator>
    <dc:date>2012-05-22T14:20:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5848">
    <title>[PATCH 5/6] fdisk: introduce fdisk context</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5848</link>
    <description>&lt;pre&gt;From: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

This is the first patch that adds the initial parts of the new fdisk internal API. Two functions are created to both init and deinit the fdisk
context. Only the device's descriptor and path are added as a start and these are replaced throughout fdisk.c and label specific code.

All logic that opens the file does it with fdisk_new_context_from_filename(), and this enforces always opening the device with rw, then, if
unsuccessful, with read-only. This changes the current logic that opens the device with certain permissions depending on the user given options.
For example, -l opens the device read-only.

This patch passed regression tests and local modifications for sgi/dos/sun disk labels.

Signed-off-by: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 fdisk/Makefile.am     |    1 +
 fdisk/fdisk.c         |   82 ++++++++++++++++++++++--------------------------
 fdisk/fdisk.h         |    9 +++++
 fdisk/fdiskbsdlabel.c |   44 +++++++++++++-------------
 fdisk/fdiskdoslabel.c |    6 ++--
 fdisk/fdisksgilabel.c |   24 +++++++-------
 fdisk/fdisksunlabel.c |   18 +++++-----
 fdisk/utils.c         |   71 ++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 165 insertions(+), 90 deletions(-)
 create mode 100644 fdisk/utils.c

diff --git a/fdisk/Makefile.am b/fdisk/Makefile.am
index 7851bd1..e9be841 100644
--- a/fdisk/Makefile.am
+++ b/fdisk/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -20,6 +20,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; if !ARCH_M68K
 sbin_PROGRAMS = fdisk
 dist_man_MANS = fdisk.8
 fdisk_SOURCES = \
+utils.c \
 fdisk.c \
 fdisk.h \
 fdiskaixlabel.c \
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index b6c5758..400e682 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -55,6 +55,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 unsigned char *MBRbuffer;
 int MBRbuffer_changed;
+struct fdisk_context *cxt = NULL;
 
 #define hex_val(c)({ \
 char _c = (c); \
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -130,12 +131,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; get_nr_sects(struct partition *p) {
 return read4_little_endian(p-&amp;gt;size4);
 }
 
-char*disk_device,/* must be specified */
-*line_ptr,/* interactive input */
+char*line_ptr,/* interactive input */
 line_buffer[LINE_LENGTH];
 
-intfd,/* the disk */
-nowarn = 0,/* no warnings for fdisk -l/-s */
+intnowarn = 0,/* no warnings for fdisk -l/-s */
 dos_compatible_flag = 0,/* disabled by default */
 dos_changed = 0,
 partitions = 4;/* maximum partition + 1 */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -183,19 +182,19 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void __attribute__ ((__noreturn__)) usage(FILE *out)
 
 void fatal(enum failure why)
 {
-close(fd);
+close(cxt-&amp;gt;dev_fd);
 switch (why) {
 case unable_to_read:
-err(EXIT_FAILURE, _("unable to read %s"), disk_device);
+err(EXIT_FAILURE, _("unable to read %s"), cxt-&amp;gt;dev_path);
 
 case unable_to_seek:
-err(EXIT_FAILURE, _("unable to seek on %s"), disk_device);
+err(EXIT_FAILURE, _("unable to seek on %s"), cxt-&amp;gt;dev_path);
 
 case unable_to_write:
-err(EXIT_FAILURE, _("unable to write %s"), disk_device);
+err(EXIT_FAILURE, _("unable to write %s"), cxt-&amp;gt;dev_path);
 
 case ioctl_error:
-err(EXIT_FAILURE, _("BLKGETSIZE ioctl failed on %s"), disk_device);
+err(EXIT_FAILURE, _("BLKGETSIZE ioctl failed on %s"), cxt-&amp;gt;dev_path);
 
 default:
 err(EXIT_FAILURE, _("fatal error"));
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -460,7 +459,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; get_topology(int fd) {
 blkid_probe pr;
 
 pr = blkid_new_probe();
-if (pr &amp;amp;&amp;amp; blkid_probe_set_device(pr, fd, 0, 0) == 0) {
+if (pr &amp;amp;&amp;amp; blkid_probe_set_device(pr, cxt-&amp;gt;dev_fd, 0, 0) == 0) {
 blkid_topology tp = blkid_probe_get_topology(pr);
 
 if (tp) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -494,7 +493,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; get_topology(int fd) {
  */
 phy_sector_size = sector_size;
 
-else if (blkdev_get_sector_size(fd, &amp;amp;arg) == 0) {
+else if (blkdev_get_sector_size(cxt-&amp;gt;dev_fd, &amp;amp;arg) == 0) {
 sector_size = arg;
 
 if (!phy_sector_size)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -664,24 +663,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int get_boot(int try_only) {
 disklabel = ANY_LABEL;
 memset(MBRbuffer, 0, 512);
 
-if (try_only &amp;amp;&amp;amp; (fd = open(disk_device, O_RDONLY)) &amp;lt; 0)
-err(EXIT_FAILURE, _("unable to open %s"), disk_device);
-else {
-if ((fd = open(disk_device, O_RDWR)) &amp;lt; 0) {
-/* ok, can we read-only the device? */
-if ((fd = open(disk_device, O_RDONLY)) &amp;lt; 0)
-err(EXIT_FAILURE, _("unable to open %s"), disk_device);
-printf(_("You will not be able to write the partition table.\n"));
-}
-}
-
-if (512 != read(fd, MBRbuffer, 512)) {
+if (512 != read(cxt-&amp;gt;dev_fd, MBRbuffer, 512)) {
 if (try_only)
 return 1;
 fatal(unable_to_read);
 }
 
-get_geometry(fd, NULL);
+get_geometry(cxt-&amp;gt;dev_fd, NULL);
 update_units();
 
 if (!check_dos_label())
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1232,11 +1220,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; list_disk_geometry(void) {
 
 if (megabytes &amp;lt; 10000)
 printf(_("\nDisk %s: %ld MB, %lld bytes\n"),
-       disk_device, megabytes, bytes);
+       cxt-&amp;gt;dev_path, megabytes, bytes);
 else {
 long hectomega = (megabytes + 50) / 100;
 printf(_("\nDisk %s: %ld.%ld GB, %llu bytes\n"),
-       disk_device, hectomega / 10, hectomega % 10, bytes);
+       cxt-&amp;gt;dev_path, hectomega / 10, hectomega % 10, bytes);
 }
 printf(_("%d heads, %llu sectors/track, %d cylinders"),
        heads, sectors, cylinders);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1424,8 +1412,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; list_table(int xtra) {
 /* Heuristic: we list partition 3 of /dev/foo as /dev/foo3,
    but if the device name ends in a digit, say /dev/foo1,
    then the partition is called /dev/foo1p3. */
-w = strlen(disk_device);
-if (w &amp;amp;&amp;amp; isdigit(disk_device[w-1]))
+w = strlen(cxt-&amp;gt;dev_path);
+if (w &amp;amp;&amp;amp; isdigit(cxt-&amp;gt;dev_path[w-1]))
 w++;
 if (w &amp;lt; 5)
 w = 5;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1450,7 +1438,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; list_table(int xtra) {
 pblocks *= (sector_size / 1024);
                         printf(
     "%s  %c %11lu %11lu %11lu%c  %2x  %s\n",
-partname(disk_device, i+1, w+2),
+partname(cxt-&amp;gt;dev_path, i+1, w+2),
 /* boot flag */!p-&amp;gt;boot_ind ? ' ' : p-&amp;gt;boot_ind == ACTIVE_FLAG
 ? '*' : '?',
 /* start */(unsigned long) cround(get_partition_start(pe)),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1480,7 +1468,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; x_list_table(int extend) {
 int i;
 
 printf(_("\nDisk %s: %d heads, %llu sectors, %d cylinders\n\n"),
-disk_device, heads, sectors, cylinders);
+cxt-&amp;gt;dev_path, heads, sectors, cylinders);
         printf(_("Nr AF  Hd Sec  Cyl  Hd Sec  Cyl     Start      Size ID\n"));
 for (i = 0 ; i &amp;lt; partitions; i++) {
 pe = &amp;amp;ptes[i];
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1695,12 +1683,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; reread_partition_table(int leave) {
 int i;
 struct stat statbuf;
 
-i = fstat(fd, &amp;amp;statbuf);
+i = fstat(cxt-&amp;gt;dev_fd, &amp;amp;statbuf);
 if (i == 0 &amp;amp;&amp;amp; S_ISBLK(statbuf.st_mode)) {
 sync();
 #ifdef BLKRRPART
 printf(_("Calling ioctl() to re-read partition table.\n"));
-i = ioctl(fd, BLKRRPART);
+i = ioctl(cxt-&amp;gt;dev_fd, BLKRRPART);
 #else
 errno = ENOSYS;
 i = 1;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1721,7 +1709,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; reread_partition_table(int leave) {
 "information.\n"));
 
 if (leave) {
-if (fsync(fd) || close(fd)) {
+if (fsync(cxt-&amp;gt;dev_fd) || close(cxt-&amp;gt;dev_fd)) {
 fprintf(stderr, _("\nError closing file\n"));
 exit(1);
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1755,7 +1743,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void
 print_raw(void) {
 int i;
 
-printf(_("Device: %s\n"), disk_device);
+printf(_("Device: %s\n"), cxt-&amp;gt;dev_path);
 if (disklabel == SUN_LABEL || disklabel == SGI_LABEL)
 print_buffer(MBRbuffer);
 else for (i = 3; i &amp;lt; partitions; i++)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1811,9 +1799,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; move_begin(int i) {
 }
 }
 
-static void __attribute__ ((__noreturn__)) handle_quit(void)
+static void __attribute__ ((__noreturn__)) handle_quit(struct fdisk_context *cxt)
 {
-close(fd);
+fdisk_free_context(cxt);
 printf("\n");
 exit(EXIT_SUCCESS);
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1883,7 +1871,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; expert_command_prompt(void)
 x_list_table(0);
 break;
 case 'q':
-handle_quit();
+handle_quit(cxt);
 case 'r':
 return;
 case 's':
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1939,7 +1927,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; print_partition_table_from_option(char *device)
 {
 int gb;
 
-disk_device = device;
+cxt = fdisk_new_context_from_filename(device);
+if (!cxt)
+err(EXIT_FAILURE, _("unable to open %s"), device);
+
 gpt_warning(device);
 gb = get_boot(1);
 if (gb &amp;lt; 0) { /* no DOS signature */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1949,7 +1940,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; print_partition_table_from_option(char *device)
 }
 else if (!gb)
 list_table(0);
-close(fd);
+fdisk_free_context(cxt);
 }
 
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2001,7 +1992,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void command_prompt(void)
 /* OSF label, and no DOS label */
 printf(_("Detected an OSF/1 disklabel on %s, entering "
  "disklabel mode.\n"),
-       disk_device);
+       cxt-&amp;gt;dev_path);
 bsd_command_prompt();
 /* If we return we may want to make an empty DOS label? */
 disklabel = DOS_LABEL;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2070,7 +2061,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void command_prompt(void)
 list_table(0);
 break;
 case 'q':
-handle_quit();
+handle_quit(cxt);
 case 's':
 create_sunlabel();
 break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2209,8 +2200,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char **argv)
 exit(EXIT_SUCCESS);
 }
 
-if (argc-optind == 1)
-disk_device = argv[optind];
+if (argc-optind == 1) {
+cxt = fdisk_new_context_from_filename(argv[optind]);
+if (!cxt)
+err(EXIT_FAILURE, _("unable to open %s"), argv[optind]);
+}
 else
 usage(stderr);
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2218,7 +2212,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char **argv)
 "Changes will remain in memory only, until you decide to write them.\n"
 "Be careful before using the write command.\n\n"), PACKAGE_STRING);
 
-gpt_warning(disk_device);
+gpt_warning(cxt-&amp;gt;dev_path);
 get_boot(0);
 
 command_prompt();
diff --git a/fdisk/fdisk.h b/fdisk/fdisk.h
index 82888dc..c43517c 100644
--- a/fdisk/fdisk.h
+++ b/fdisk/fdisk.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -63,6 +63,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct geom {
 unsigned int cylinders;
 };
 
+struct fdisk_context {
+int dev_fd;     /* device descriptor */
+char *dev_path; /* device path */
+};
+
+extern struct fdisk_context *cxt;
+extern struct fdisk_context *fdisk_new_context_from_filename(const char *fname);
+extern void fdisk_free_context(struct fdisk_context *cxt);
+
 /* prototypes for fdisk.c */
 extern char *disk_device, *line_ptr;
 extern int fd, partitions;
diff --git a/fdisk/fdiskbsdlabel.c b/fdisk/fdiskbsdlabel.c
index 9dfc95a..670e9bc 100644
--- a/fdisk/fdiskbsdlabel.c
+++ b/fdisk/fdiskbsdlabel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -153,11 +153,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bsd_command_prompt (void)
       ss = get_start_sect(xbsd_part);
       if (ss == 0) {
 fprintf (stderr, _("Partition %s has invalid starting sector 0.\n"),
- partname(disk_device, t+1, 0));
+ partname(cxt-&amp;gt;dev_path, t+1, 0));
 return;
       }
       printf (_("Reading disklabel of %s at sector %d.\n"),
-      partname(disk_device, t+1, 0), ss + BSD_LABELSECTOR);
+      partname(cxt-&amp;gt;dev_path, t+1, 0), ss + BSD_LABELSECTOR);
       if (xbsd_readlabel (xbsd_part, &amp;amp;xbsd_dlabel) == 0)
 if (xbsd_create_disklabel () == 0)
   return;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -166,7 +166,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bsd_command_prompt (void)
   }
 
   if (t == 4) {
-    printf (_("There is no *BSD partition on %s.\n"), disk_device);
+    printf (_("There is no *BSD partition on %s.\n"), cxt-&amp;gt;dev_path);
     return;
   }
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -200,7 +200,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bsd_command_prompt (void)
 xbsd_print_disklabel (0);
 break;
       case 'q':
-close (fd);
+close (cxt-&amp;gt;dev_fd);
 exit ( EXIT_SUCCESS );
       case 'r':
 return;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -289,9 +289,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; xbsd_print_disklabel (int show_all) {
 
   if (show_all) {
 #if defined (__alpha__)
-    fprintf(f, "# %s:\n", disk_device);
+    fprintf(f, "# %s:\n", cxt-&amp;gt;dev_path);
 #else
-    fprintf(f, "# %s:\n", partname(disk_device, xbsd_part_index+1, 0));
+    fprintf(f, "# %s:\n", partname(cxt-&amp;gt;dev_path, xbsd_part_index+1, 0));
 #endif
     if ((unsigned) lp-&amp;gt;d_type &amp;lt; BSD_DKMAXTYPES)
       fprintf(f, _("type: %s\n"), xbsd_dktypenames[lp-&amp;gt;d_type]);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -381,11 +381,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; xbsd_print_disklabel (int show_all) {
 static void
 xbsd_write_disklabel (void) {
 #if defined (__alpha__)
-printf (_("Writing disklabel to %s.\n"), disk_device);
+printf (_("Writing disklabel to %s.\n"), cxt-&amp;gt;dev_path);
 xbsd_writelabel (NULL, &amp;amp;xbsd_dlabel);
 #else
 printf (_("Writing disklabel to %s.\n"),
-partname(disk_device, xbsd_part_index+1, 0));
+partname(cxt-&amp;gt;dev_path, xbsd_part_index+1, 0));
 xbsd_writelabel (xbsd_part, &amp;amp;xbsd_dlabel);
 #endif
 reread_partition_table(0);/* no exit yet */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -396,10 +396,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; xbsd_create_disklabel (void) {
 char c;
 
 #if defined (__alpha__)
-fprintf (stderr, _("%s contains no disklabel.\n"), disk_device);
+fprintf (stderr, _("%s contains no disklabel.\n"), cxt-&amp;gt;dev_path);
 #else
 fprintf (stderr, _("%s contains no disklabel.\n"),
- partname(disk_device, xbsd_part_index+1, 0));
+ partname(cxt-&amp;gt;dev_path, xbsd_part_index+1, 0));
 #endif
 
 while (1) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -545,16 +545,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; xbsd_write_bootstrap (void)
   sector = get_start_sect(xbsd_part);
 #endif
 
-  if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
+  if (lseek (cxt-&amp;gt;dev_fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
     fatal (unable_to_seek);
-  if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
+  if (BSD_BBSIZE != write (cxt-&amp;gt;dev_fd, disklabelbuffer, BSD_BBSIZE))
     fatal (unable_to_write);
 
 #if defined (__alpha__)
-  printf (_("Bootstrap installed on %s.\n"), disk_device);
+  printf (_("Bootstrap installed on %s.\n"), cxt-&amp;gt;dev_path);
 #else
   printf (_("Bootstrap installed on %s.\n"),
-    partname (disk_device, xbsd_part_index+1, 0));
+    partname (cxt-&amp;gt;dev_path, xbsd_part_index+1, 0));
 #endif
 
   sync_disks ();
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -636,12 +636,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; xbsd_initlabel (struct partition *p, struct xbsd_disklabel *d,
 struct xbsd_partition *pp;
 struct geom g;
 
-get_geometry (fd, &amp;amp;g);
+get_geometry (cxt-&amp;gt;dev_fd, &amp;amp;g);
 memset (d, 0, sizeof (struct xbsd_disklabel));
 
 d -&amp;gt; d_magic = BSD_DISKMAGIC;
 
-if (strncmp (disk_device, "/dev/sd", 7) == 0)
+if (strncmp (cxt-&amp;gt;dev_path, "/dev/sd", 7) == 0)
 d -&amp;gt; d_type = BSD_DTYPE_SCSI;
 else
 d -&amp;gt; d_type = BSD_DTYPE_ST506;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -715,9 +715,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; xbsd_readlabel (struct partition *p, struct xbsd_disklabel *d)
 sector = 0;
 #endif
 
-if (lseek (fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
+if (lseek (cxt-&amp;gt;dev_fd, (off_t) sector * SECTOR_SIZE, SEEK_SET) == -1)
 fatal (unable_to_seek);
-if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
+if (BSD_BBSIZE != read (cxt-&amp;gt;dev_fd, disklabelbuffer, BSD_BBSIZE))
 fatal (unable_to_read);
 
 memmove (d,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -762,15 +762,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; xbsd_writelabel (struct partition *p, struct xbsd_disklabel *d)
 
 #if defined (__alpha__) &amp;amp;&amp;amp; BSD_LABELSECTOR == 0
   alpha_bootblock_checksum (disklabelbuffer);
-  if (lseek (fd, (off_t) 0, SEEK_SET) == -1)
+  if (lseek (cxt-&amp;gt;dev_fd, (off_t) 0, SEEK_SET) == -1)
     fatal (unable_to_seek);
-  if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
+  if (BSD_BBSIZE != write (cxt-&amp;gt;dev_fd, disklabelbuffer, BSD_BBSIZE))
     fatal (unable_to_write);
 #else
-  if (lseek (fd, (off_t) sector * SECTOR_SIZE + BSD_LABELOFFSET,
+  if (lseek (cxt-&amp;gt;dev_fd, (off_t) sector * SECTOR_SIZE + BSD_LABELOFFSET,
    SEEK_SET) == -1)
     fatal (unable_to_seek);
-  if (sizeof (struct xbsd_disklabel) != write (fd, d, sizeof (struct xbsd_disklabel)))
+  if (sizeof (struct xbsd_disklabel) != write (cxt-&amp;gt;dev_fd, d, sizeof (struct xbsd_disklabel)))
     fatal (unable_to_write);
 #endif
 
diff --git a/fdisk/fdiskdoslabel.c b/fdisk/fdiskdoslabel.c
index 34bcde6..4a93691 100644
--- a/fdisk/fdiskdoslabel.c
+++ b/fdisk/fdiskdoslabel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -156,7 +156,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void read_extended(int ext)
 return;
 }
 
-read_pte(fd, partitions, extended_offset + get_start_sect(p));
+read_pte(cxt-&amp;gt;dev_fd, partitions, extended_offset + get_start_sect(p));
 
 if (!extended_offset)
 extended_offset = get_start_sect(p);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -670,7 +670,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void dos_write_table(void)
 }
 if (MBRbuffer_changed) {
 write_part_table_flag(MBRbuffer);
-write_sector(fd, 0, MBRbuffer);
+write_sector(cxt-&amp;gt;dev_fd, 0, MBRbuffer);
 }
 /* EBR (logical partitions) */
 for (i = 4; i &amp;lt; partitions; i++) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -678,7 +678,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void dos_write_table(void)
 
 if (pe-&amp;gt;changed) {
 write_part_table_flag(pe-&amp;gt;sectorbuffer);
-write_sector(fd, pe-&amp;gt;offset, pe-&amp;gt;sectorbuffer);
+write_sector(cxt-&amp;gt;dev_fd, pe-&amp;gt;offset, pe-&amp;gt;sectorbuffer);
 }
 }
 }
diff --git a/fdisk/fdisksgilabel.c b/fdisk/fdisksgilabel.c
index 5e851bc..c2ef06d 100644
--- a/fdisk/fdisksgilabel.c
+++ b/fdisk/fdisksgilabel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -183,7 +183,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; sgi_list_table(int xtra) {
 int kpi = 0;/* kernel partition ID */
 char *type;
 
-w = strlen(disk_device);
+w = strlen(cxt-&amp;gt;dev_path);
 
 if (xtra) {
 printf(_("\nDisk %s (SGI disk label): %d heads, %llu sectors\n"
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -191,7 +191,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; sgi_list_table(int xtra) {
  "%d extra sects/cyl, interleave %d:1\n"
  "%s\n"
  "Units = %s of %d * %d bytes\n\n"),
-       disk_device, heads, sectors, cylinders,
+       cxt-&amp;gt;dev_path, heads, sectors, cylinders,
        SSWAP16(sgiparam.pcylcount),
        (int) sgiparam.sparecyl, SSWAP16(sgiparam.ilfact),
        (char *)sgilabel,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -201,7 +201,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; sgi_list_table(int xtra) {
 printf(_("\nDisk %s (SGI disk label): "
  "%d heads, %llu sectors, %d cylinders\n"
  "Units = %s of %d * %d bytes\n\n"),
-       disk_device, heads, sectors, cylinders,
+       cxt-&amp;gt;dev_path, heads, sectors, cylinders,
        str_units(PLURAL), units_per_sector,
                        sector_size);
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -216,7 +216,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; sgi_list_table(int xtra) {
 printf(
 "%2d: %s %4s %9ld %9ld %9ld  %2x  %s\n",
 /* fdisk part number */   i+1,
-/* device */              partname(disk_device, kpi, w+2),
+/* device */              partname(cxt-&amp;gt;dev_path, kpi, w+2),
 /* flags */               (sgi_get_swappartition() == i) ? "swap" :
 /* flags */               (sgi_get_bootpartition() == i) ? "boot" : "    ", 
 /* start */               (long) scround(start),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -357,9 +357,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; sgi_write_table(void) {
 sizeof(*sgilabel)));
 assert(two_s_complement_32bit_sum(
 (unsigned int*)sgilabel, sizeof(*sgilabel)) == 0);
-if (lseek(fd, 0, SEEK_SET) &amp;lt; 0)
+if (lseek(cxt-&amp;gt;dev_fd, 0, SEEK_SET) &amp;lt; 0)
 fatal(unable_to_seek);
-if (write(fd, sgilabel, SECTOR_SIZE) != SECTOR_SIZE)
+if (write(cxt-&amp;gt;dev_fd, sgilabel, SECTOR_SIZE) != SECTOR_SIZE)
 fatal(unable_to_write);
 if (! strncmp((char *) sgilabel-&amp;gt;directory[0].vol_file_name, "sgilabel", 8)) {
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -368,10 +368,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; sgi_write_table(void) {
  */
 sgiinfo *info = fill_sgiinfo();
 int infostartblock = SSWAP32(sgilabel-&amp;gt;directory[0].vol_file_start);
-if (lseek(fd, (off_t) infostartblock*
+if (lseek(cxt-&amp;gt;dev_fd, (off_t) infostartblock*
 SECTOR_SIZE, SEEK_SET) &amp;lt; 0)
 fatal(unable_to_seek);
-if (write(fd, info, SECTOR_SIZE) != SECTOR_SIZE)
+if (write(cxt-&amp;gt;dev_fd, info, SECTOR_SIZE) != SECTOR_SIZE)
 fatal(unable_to_write);
 free(info);
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -702,11 +702,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; create_sgilabel(void)
 
 other_endian = (BYTE_ORDER == LITTLE_ENDIAN);
 
-res = blkdev_get_sectors(fd, &amp;amp;llsectors);
+res = blkdev_get_sectors(cxt-&amp;gt;dev_fd, &amp;amp;llsectors);
 
 #ifdef HDIO_GETGEO
-if (ioctl(fd, HDIO_GETGEO, &amp;amp;geometry) &amp;lt; 0)
-err(EXIT_FAILURE, _("HDIO_GETGEO ioctl failed on %s"), disk_device);
+if (ioctl(cxt-&amp;gt;dev_fd, HDIO_GETGEO, &amp;amp;geometry) &amp;lt; 0)
+err(EXIT_FAILURE, _("HDIO_GETGEO ioctl failed on %s"), cxt-&amp;gt;dev_path);
 
 heads = geometry.heads;
 sectors = geometry.sectors;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -724,7 +724,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; create_sgilabel(void)
 _("Warning:  BLKGETSIZE ioctl failed on %s.  "
   "Using geometry cylinder value of %d.\n"
   "This value may be truncated for devices"
-  " &amp;gt; 33.8 GB.\n"), disk_device, cylinders);
+  " &amp;gt; 33.8 GB.\n"), cxt-&amp;gt;dev_path, cylinders);
 }
 #endif
 for (i = 0; i &amp;lt; 4; i++) {
diff --git a/fdisk/fdisksunlabel.c b/fdisk/fdisksunlabel.c
index 4a6db35..6944824 100644
--- a/fdisk/fdisksunlabel.c
+++ b/fdisk/fdisksunlabel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -172,11 +172,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void create_sunlabel(void)
 sunlabel-&amp;gt;version = SSWAP32(SUN_LABEL_VERSION);
 sunlabel-&amp;gt;num_partitions = SSWAP16(SUN_NUM_PARTITIONS);
 
-res = blkdev_get_sectors(fd, &amp;amp;llsectors);
+res = blkdev_get_sectors(cxt-&amp;gt;dev_fd, &amp;amp;llsectors);
 sec_fac = sector_size / 512;
 
 #ifdef HDIO_GETGEO
-if (!ioctl(fd, HDIO_GETGEO, &amp;amp;geometry)) {
+if (!ioctl(cxt-&amp;gt;dev_fd, HDIO_GETGEO, &amp;amp;geometry)) {
         heads = geometry.heads;
         sectors = geometry.sectors;
 if (res == 0) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -190,7 +190,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void create_sunlabel(void)
 _("Warning:  BLKGETSIZE ioctl failed on %s.  "
   "Using geometry cylinder value of %d.\n"
   "This value may be truncated for devices"
-  " &amp;gt; 33.8 GB.\n"), disk_device, cylinders);
+  " &amp;gt; 33.8 GB.\n"), cxt-&amp;gt;dev_path, cylinders);
 }
 } else
 #endif
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -538,7 +538,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void sun_list_table(int xtra)
 int i, w;
 char *type;
 
-w = strlen(disk_device);
+w = strlen(cxt-&amp;gt;dev_path);
 if (xtra)
 printf(
 _("\nDisk %s (Sun disk label): %u heads, %llu sectors, %d rpm\n"
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -547,7 +547,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void sun_list_table(int xtra)
 "Label ID: %s\n"
 "Volume ID: %s\n"
 "Units = %s of %d * 512 bytes\n\n"),
-       disk_device, heads, sectors, SSWAP16(sunlabel-&amp;gt;rpm),
+       cxt-&amp;gt;dev_path, heads, sectors, SSWAP16(sunlabel-&amp;gt;rpm),
        cylinders, SSWAP16(sunlabel-&amp;gt;acyl),
        SSWAP16(sunlabel-&amp;gt;pcyl),
        SSWAP16(sunlabel-&amp;gt;apc),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -559,7 +559,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void sun_list_table(int xtra)
 printf(
 _("\nDisk %s (Sun disk label): %u heads, %llu sectors, %u cylinders\n"
 "Units = %s of %d * 512 bytes\n\n"),
-       disk_device, heads, sectors, cylinders,
+       cxt-&amp;gt;dev_path, heads, sectors, cylinders,
        str_units(PLURAL), units_per_sector);
 
 printf(_("%*s Flag    Start       End    Blocks   Id  System\n"),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -573,7 +573,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void sun_list_table(int xtra)
 uint32_t len = SSWAP32(part-&amp;gt;num_sectors);
 printf(
     "%s %c%c %9lu %9lu %9lu%c  %2x  %s\n",
-/* device */  partname(disk_device, i+1, w),
+/* device */  partname(cxt-&amp;gt;dev_path, i+1, w),
 /* flags */  (tag-&amp;gt;flag &amp;amp; SSWAP16(SUN_FLAG_UNMNT)) ? 'u' : ' ',
   (tag-&amp;gt;flag &amp;amp; SSWAP16(SUN_FLAG_RONLY)) ? 'r' : ' ',
 /* start */  (unsigned long) scround(start),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -634,9 +634,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void sun_write_table(void)
 while(ush &amp;lt; (unsigned short *)(&amp;amp;sunlabel-&amp;gt;cksum))
 csum ^= *ush++;
 sunlabel-&amp;gt;cksum = csum;
-if (lseek(fd, 0, SEEK_SET) &amp;lt; 0)
+if (lseek(cxt-&amp;gt;dev_fd, 0, SEEK_SET) &amp;lt; 0)
 fatal(unable_to_seek);
-if (write(fd, sunlabel, SECTOR_SIZE) != SECTOR_SIZE)
+if (write(cxt-&amp;gt;dev_fd, sunlabel, SECTOR_SIZE) != SECTOR_SIZE)
 fatal(unable_to_write);
 }
 
diff --git a/fdisk/utils.c b/fdisk/utils.c
new file mode 100644
index 0000000..ad83d7f
--- /dev/null
+++ b/fdisk/utils.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,71 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ *  Copyright (C) 2012 Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include &amp;lt;string.h&amp;gt;
+#include &amp;lt;stdlib.h&amp;gt;
+#include &amp;lt;unistd.h&amp;gt;
+
+#include "common.h"
+#include "fdisk.h"
+
+/**
+ * fdisk_new_context:
+ *
+ * Returns: newly allocated fdisk context
+ */
+struct fdisk_context *fdisk_new_context_from_filename(const char *fname)
+{
+int fd;
+struct fdisk_context *cxt = NULL;
+
+/*
+ * Attempt to open the device with r-w permissions
+ * by default, otherwise try read-only.
+ */
+if ((fd = open(fname, O_RDWR)) &amp;lt; 0)
+if ((fd = open(fname, O_RDONLY)) &amp;lt; 0)
+goto ret;
+
+cxt = calloc(1, sizeof(*cxt));
+if (!cxt)
+goto ret;
+
+cxt-&amp;gt;dev_fd = fd;
+cxt-&amp;gt;dev_path = strdup(fname);
+if (!cxt-&amp;gt;dev_path)
+return NULL;
+ret:
+return cxt;
+}
+
+/**
+ * fdisk_free_context:
+ * &amp;lt; at &amp;gt;cxt: fdisk context
+ *
+ * Deallocates context struct.
+ */
+void fdisk_free_context(struct fdisk_context *cxt)
+{
+if (!cxt)
+return;
+
+close(cxt-&amp;gt;dev_fd);
+free(cxt-&amp;gt;dev_path);
+free(cxt);
+}
+
&lt;/pre&gt;</description>
    <dc:creator>Davidlohr Bueso</dc:creator>
    <dc:date>2012-05-20T16:11:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5847">
    <title>[PATCH 6/6] fdisk: add debug support</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5847</link>
    <description>&lt;pre&gt;From: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

Based on libmnt, this patch adds basic debugging support for fdisk. Currently only CONTEXT is debugged, yet keeps exact functionality
as libmnt/libblkid.

Signed-off-by: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 fdisk/fdisk.c |    2 ++
 fdisk/fdisk.h |   27 +++++++++++++++++++++++++++
 fdisk/utils.c |   33 ++++++++++++++++++++++++++++++++-
 3 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 400e682..9b91fa0 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2168,6 +2168,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char **argv)
 }
 }
 
+fdisk_init_debug(0);
+
 if (user_set_sector_size &amp;amp;&amp;amp; argc-optind != 1)
 printf(_("Warning: the -b (set sector size) option should"
  " be used with one specified device\n"));
diff --git a/fdisk/fdisk.h b/fdisk/fdisk.h
index c43517c..2471541 100644
--- a/fdisk/fdisk.h
+++ b/fdisk/fdisk.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -32,6 +32,33 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #define cround(n)(display_in_cyl_units ? ((n)/units_per_sector)+1 : (n))
 #define scround(x)(((x)+units_per_sector-1)/units_per_sector)
 
+/* fdisk debugging flags/options */
+#define FDISK_DEBUG_INIT(1 &amp;lt;&amp;lt; 1)
+#define FDISK_DEBUG_CONTEXT(1 &amp;lt;&amp;lt; 2)
+#define FDISK_DEBUG_ALL0xFFFF
+
+# define ON_DBG(m, x)do { \
+if ((FDISK_DEBUG_ ## m) &amp;amp; fdisk_debug_mask) { \
+x; \
+}   \
+} while (0)
+
+# define DBG(m, x)do { \
+if ((FDISK_DEBUG_ ## m) &amp;amp; fdisk_debug_mask) { \
+fprintf(stderr, "%d: fdisk: %8s: ", getpid(), # m); \
+x;\
+} \
+} while (0)
+
+# define DBG_FLUSHdo { \
+if (fdisk_debug_mask &amp;amp;&amp;amp; \
+    fdisk_debug_mask != FDISK_DEBUG_INIT) \
+fflush(stderr);\
+} while(0)
+
+extern int fdisk_debug_mask;
+extern void fdisk_init_debug(int mask);
+
 struct partition {
 unsigned char boot_ind;         /* 0x80 - active */
 unsigned char head;             /* starting head */
diff --git a/fdisk/utils.c b/fdisk/utils.c
index ad83d7f..9f071a6 100644
--- a/fdisk/utils.c
+++ b/fdisk/utils.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -23,6 +23,35 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "common.h"
 #include "fdisk.h"
 
+int fdisk_debug_mask;
+
+/**
+ * fdisk_init_debug:
+ * &amp;lt; at &amp;gt;mask: debug mask (0xffff to enable full debuging)
+ *
+ * If the &amp;lt; at &amp;gt;mask is not specified then this function reads
+ * FDISK_DEBUG environment variable to get the mask.
+ *
+ * Already initialized debugging stuff cannot be changed. It does not
+ * have effect to call this function twice.
+ */
+void fdisk_init_debug(int mask)
+{
+if (fdisk_debug_mask &amp;amp; FDISK_DEBUG_INIT)
+return;
+if (!mask) {
+char *str = getenv("FDISK_DEBUG");
+if (str)
+fdisk_debug_mask = strtoul(str, 0, 0);
+} else
+fdisk_debug_mask = mask;
+
+if (fdisk_debug_mask)
+printf("fdisk: debug mask set to 0x%04x.\n",
+       fdisk_debug_mask);
+fdisk_debug_mask |= FDISK_DEBUG_INIT;
+}
+
 /**
  * fdisk_new_context:
  *
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -37,9 +66,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct fdisk_context *fdisk_new_context_from_filename(const char *fname)
  * Attempt to open the device with r-w permissions
  * by default, otherwise try read-only.
  */
-if ((fd = open(fname, O_RDWR)) &amp;lt; 0)
+if ((fd = open(fname, O_RDWR)) &amp;lt; 0) {
 if ((fd = open(fname, O_RDONLY)) &amp;lt; 0)
 goto ret;
+DBG(CONTEXT, printf("opened %s as read-only\n", fname));
+}
 
 cxt = calloc(1, sizeof(*cxt));
 if (!cxt)
&lt;/pre&gt;</description>
    <dc:creator>Davidlohr Bueso</dc:creator>
    <dc:date>2012-05-20T16:11:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5846">
    <title>[PATCH 4/6] fdisk: use BSD label header</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5846</link>
    <description>&lt;pre&gt;From: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

Move bsd specific function definitions into its own header file and include it in fdisk code.

Signed-off-by: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 fdisk/fdisk.c         |    1 +
 fdisk/fdisk.h         |    6 ------
 fdisk/fdiskbsdlabel.h |    5 +++++
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 08afb45..b6c5758 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -39,6 +39,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "fdiskaixlabel.h"
 #include "fdiskmaclabel.h"
 #include "fdiskdoslabel.h"
+#include "fdiskbsdlabel.h"
 
 #ifdef HAVE_LINUX_COMPILER_H
 #include &amp;lt;linux/compiler.h&amp;gt;
diff --git a/fdisk/fdisk.h b/fdisk/fdisk.h
index 0dafbf8..82888dc 100644
--- a/fdisk/fdisk.h
+++ b/fdisk/fdisk.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -185,9 +185,3 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline int is_cleared_partition(struct partition *p)
  p-&amp;gt;sys_ind || p-&amp;gt;end_head || p-&amp;gt;end_sector || p-&amp;gt;end_cyl ||
  get_start_sect(p) || get_nr_sects(p));
 }
-
-/* prototypes for fdiskbsdlabel.c */
-extern void bsd_command_prompt(void);
-extern int check_osf_label(void);
-extern int btrydev(char * dev);
-extern void xbsd_print_disklabel(int);
diff --git a/fdisk/fdiskbsdlabel.h b/fdisk/fdiskbsdlabel.h
index e58e2ff..9bea7cf 100644
--- a/fdisk/fdiskbsdlabel.h
+++ b/fdisk/fdiskbsdlabel.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -238,4 +238,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct systypes xbsd_fstypes[] = {
 #defineBSD_D_CHAIN    0x10/* can do back-back transfers */
 #defineBSD_D_DOSPART0x20/* within MSDOS partition */
 
+extern void bsd_command_prompt(void);
+extern int check_osf_label(void);
+extern int btrydev(char * dev);
+extern void xbsd_print_disklabel(int);
+
 #endif /* FDISK_BSD_LABEL_H */
&lt;/pre&gt;</description>
    <dc:creator>Davidlohr Bueso</dc:creator>
    <dc:date>2012-05-20T16:11:33</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5845">
    <title>[PATCH 3/6] fdisk: refactor -s option</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5845</link>
    <description>&lt;pre&gt;From: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

Signed-off-by: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 fdisk/fdisk.c |   41 ++++++++++++++++++++++-------------------
 1 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 9387795..08afb45 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2095,10 +2095,22 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void command_prompt(void)
 }
 }
 
+static unsigned long long get_dev_sz(char *dev)
+{
+int fd;
+unsigned long long size;
+
+if ((fd = open(dev, O_RDONLY)) &amp;lt; 0)
+err(EXIT_FAILURE, _("unable to open %s"), dev);
+if (blkdev_get_sectors(fd, &amp;amp;size) == -1)
+fatal(ioctl_error);
+close(fd);
+return size/2;
+}
+
 int main(int argc, char **argv)
 {
-int j, c;
-int optl = 0, opts = 0;
+int c, optl = 0, opts = 0;
 
 setlocale(LC_ALL, "");
 bindtextdomain(PACKAGE, LOCALEDIR);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2182,27 +2194,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char **argv)
 }
 
 if (opts) {
-unsigned long long size;
-
-nowarn = 1;
-
-opts = argc - optind;
-if (opts &amp;lt;= 0)
+/* print partition size for one or more devices */
+int i, ndevs = argc - optind;
+if (ndevs &amp;lt;= 0)
 usage(stderr);
 
-for (j = optind; j &amp;lt; argc; j++) {
-disk_device = argv[j];
-if ((fd = open(disk_device, O_RDONLY)) &amp;lt; 0)
-err(EXIT_FAILURE, _("unable to open %s"), disk_device);
-if (blkdev_get_sectors(fd, &amp;amp;size) == -1)
-fatal(ioctl_error);
-close(fd);
-if (opts == 1)
-printf("%llu\n", size/2);
+for (i = optind; i &amp;lt; argc; i++) {
+if (ndevs == 1)
+printf("%llu\n", get_dev_sz(argv[i]));
 else
-printf("%s: %llu\n", argv[j], size/2);
+printf("%s: %llu\n", argv[i], get_dev_sz(argv[i]));
 }
-exit(0);
+exit(EXIT_SUCCESS);
 }
 
 if (argc-optind == 1)
&lt;/pre&gt;</description>
    <dc:creator>Davidlohr Bueso</dc:creator>
    <dc:date>2012-05-20T16:11:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5844">
    <title>[PATCH 2/6] fdisk: remove bogus statement</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5844</link>
    <description>&lt;pre&gt;From: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

usage() does not return, also move the help option handling to the bottom of the switch.

Signed-off-by: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 fdisk/fdisk.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 2f3c119..9387795 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2095,8 +2095,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void command_prompt(void)
 }
 }
 
-int
-main(int argc, char **argv) {
+int main(int argc, char **argv)
+{
 int j, c;
 int optl = 0, opts = 0;
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2130,9 +2130,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; main(int argc, char **argv) {
 else if (optarg &amp;amp;&amp;amp; strcmp(optarg, "=nondos"))
 usage(stderr);
 break;
-case 'h':
-usage(stdout);
-break;
 case 'H':
 user_heads = strtou32_or_err(optarg, _("invalid heads argument"));
 if (user_heads &amp;gt; 256)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2160,6 +2157,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; main(int argc, char **argv) {
 case 'v':
 printf(UTIL_LINUX_VERSION);
 return EXIT_SUCCESS;
+case 'h':
+usage(stdout);
 default:
 usage(stderr);
 }
&lt;/pre&gt;</description>
    <dc:creator>Davidlohr Bueso</dc:creator>
    <dc:date>2012-05-20T16:11:26</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5843">
    <title>[PATCH 1/6] fdisk: add an quit/exit handling function</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5843</link>
    <description>&lt;pre&gt;From: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

Signed-off-by: Davidlohr Bueso &amp;lt;dave-mXXj517/zsQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 fdisk/fdisk.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 3f83297..2f3c119 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1810,6 +1810,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; move_begin(int i) {
 }
 }
 
+static void __attribute__ ((__noreturn__)) handle_quit(void)
+{
+close(fd);
+printf("\n");
+exit(EXIT_SUCCESS);
+}
+
 static void
 expert_command_prompt(void)
 {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1875,9 +1882,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; expert_command_prompt(void)
 x_list_table(0);
 break;
 case 'q':
-close(fd);
-printf("\n");
-exit(0);
+handle_quit();
 case 'r':
 return;
 case 's':
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2064,9 +2069,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void command_prompt(void)
 list_table(0);
 break;
 case 'q':
-close(fd);
-printf("\n");
-exit(0);
+handle_quit();
 case 's':
 create_sunlabel();
 break;
&lt;/pre&gt;</description>
    <dc:creator>Davidlohr Bueso</dc:creator>
    <dc:date>2012-05-20T16:11:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5839">
    <title>[PATCH 1/3] findmnt: reference correct manual section</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5839</link>
    <description>&lt;pre&gt;Signed-off-by: Dave Reisner &amp;lt;dreisner-fd97jBR+K/6hPH1hqNUYSQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 misc-utils/findmnt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index 1d34696..9005483 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1005,7 +1005,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void __attribute__((__noreturn__)) usage(FILE *out)
 for (i = 0; i &amp;lt; FINDMNT_NCOLUMNS; i++)
 fprintf(out, " %11s  %s\n", infos[i].name, _(infos[i].help));
 
-fprintf(out, USAGE_MAN_TAIL("findmnt(1)"));
+fprintf(out, USAGE_MAN_TAIL("findmnt(8)"));
 
 exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
 }
&lt;/pre&gt;</description>
    <dc:creator>Dave Reisner</dc:creator>
    <dc:date>2012-05-20T00:39:19</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5833">
    <title>[PATCH 1/4] last: use min() from c.h</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5833</link>
    <description>&lt;pre&gt;
Signed-off-by: Petr Uzel &amp;lt;petr.uzel-AlSwsSmVLrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 login-utils/last.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/login-utils/last.c b/login-utils/last.c
index 34558bb..62fc55c 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -72,15 +72,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct utmputmpbuf;
 #defineLMAX(int)sizeof(utmpbuf.ut_line)/* size of utmp tty field */
 #defineNMAX(int)sizeof(utmpbuf.ut_name)/* size of utmp name field */
 
-#ifndef MIN
-#define MIN(a,b)(((a) &amp;lt; (b)) ? (a) : (b))
-#endif
&lt;/pre&gt;</description>
    <dc:creator>Petr Uzel</dc:creator>
    <dc:date>2012-05-17T07:41:06</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5827">
    <title>[PATCH 1/2] blkid: use symbolic exit code</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5827</link>
    <description>&lt;pre&gt;
Signed-off-by: Petr Uzel &amp;lt;petr.uzel-AlSwsSmVLrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 misc-utils/blkid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c
index 8007840..4f7050f 100644
--- a/misc-utils/blkid.c
+++ b/misc-utils/blkid.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -720,7 +720,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(int argc, char **argv)
 
 while (blkid_superblocks_get_name(idx++, &amp;amp;name, NULL) == 0)
 printf("%s\n", name);
-exit(0);
+exit(EXIT_SUCCESS);
 }
 case 'o':
 if (!strcmp(optarg, "value"))
&lt;/pre&gt;</description>
    <dc:creator>Petr Uzel</dc:creator>
    <dc:date>2012-05-16T08:38:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5811">
    <title>[PATCH 1/4] include: rename writeall.h to all-io.h</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5811</link>
    <description>&lt;pre&gt;
Signed-off-by: Petr Uzel &amp;lt;petr.uzel-AlSwsSmVLrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 disk-utils/fsck.minix.c |    2 +-
 disk-utils/mkfs.minix.c |    2 +-
 disk-utils/mkswap.c     |    2 +-
 disk-utils/swaplabel.c  |    2 +-
 include/Makefile.am     |    2 +-
 include/all-io.h        |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 include/writeall.h      |   47 -----------------------------------------------
 lib/path.c              |    2 +-
 libblkid/src/probe.c    |    2 +-
 login-utils/login.c     |    2 +-
 misc-utils/uuidd.c      |    2 +-
 misc-utils/wipefs.c     |    2 +-
 sys-utils/dmesg.c       |    2 +-
 term-utils/agetty.c     |    2 +-
 text-utils/pg.c         |    2 +-
 15 files changed, 60 insertions(+), 60 deletions(-)
 create mode 100644 include/all-io.h
 delete mode 100644 include/writeall.h

diff --git a/disk-utils/fsck.minix.c b/disk-utils/fsck.minix.c
index 139ab7a..5e56e83 100644
--- a/disk-utils/fsck.minix.c
+++ b/disk-utils/fsck.minix.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -109,7 +109,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "pathnames.h"
 #include "bitops.h"
 #include "ismounted.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "closestream.h"
 
 #define ROOT_INO 1
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index 051cd5f..c5baac1 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -84,7 +84,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "bitops.h"
 #include "exitcodes.h"
 #include "strutils.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "closestream.h"
 
 #define MINIX_ROOT_INO 1
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index 51a0c89..b3bc586 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -54,7 +54,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "blkdev.h"
 #include "pathnames.h"
 #include "wholedisk.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "xalloc.h"
 #include "c.h"
 #include "closestream.h"
diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c
index 716db9e..bf4ee71 100644
--- a/disk-utils/swaplabel.c
+++ b/disk-utils/swaplabel.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -27,7 +27,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 #include "c.h"
 #include "closestream.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "swapheader.h"
 #include "strutils.h"
 #include "nls.h"
diff --git a/include/Makefile.am b/include/Makefile.am
index f61cb04..82164e4 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 include $(top_srcdir)/config/include-Makefile.am
 
 dist_noinst_HEADERS = \
+all-io.h \
 at.h \
 bitops.h \
 blkdev.h \
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -40,6 +41,5 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; dist_noinst_HEADERS = \
 usleep.h \
 wholedisk.h \
 widechar.h \
-writeall.h \
 xalloc.h \
 xgetpass.h
diff --git a/include/all-io.h b/include/all-io.h
new file mode 100644
index 0000000..4d1ae1e
--- /dev/null
+++ b/include/all-io.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,47 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+#ifndef UTIL_LINUX_ALL_IO_H
+#define UTIL_LINUX_ALL_IO_H
+
+#include &amp;lt;string.h&amp;gt;
+#include &amp;lt;unistd.h&amp;gt;
+#include &amp;lt;errno.h&amp;gt;
+
+static inline int write_all(int fd, const void *buf, size_t count)
+{
+while (count) {
+ssize_t tmp;
+
+errno = 0;
+tmp = write(fd, buf, count);
+if (tmp &amp;gt; 0) {
+count -= tmp;
+if (count)
+buf += tmp;
+} else if (errno != EINTR &amp;amp;&amp;amp; errno != EAGAIN)
+return -1;
+if (errno == EAGAIN)/* Try later, *sigh* */
+usleep(10000);
+}
+return 0;
+}
+
+static inline int fwrite_all(const void *ptr, size_t size,
+     size_t nmemb, FILE *stream)
+{
+while (nmemb) {
+size_t tmp;
+
+errno = 0;
+tmp = fwrite(ptr, size, nmemb, stream);
+if (tmp &amp;gt; 0) {
+nmemb -= tmp;
+if (nmemb)
+ptr += (tmp * size);
+} else if (errno != EINTR &amp;amp;&amp;amp; errno != EAGAIN)
+return -1;
+if (errno == EAGAIN)/* Try later, *sigh* */
+usleep(10000);
+}
+return 0;
+}
+
+#endif /* UTIL_LINUX_ALL_IO_H */
diff --git a/include/writeall.h b/include/writeall.h
deleted file mode 100644
index 6aa4927..0000000
--- a/include/writeall.h
+++ /dev/null
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,47 +0,0 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
-#ifndef UTIL_LINUX_WRITEALL_H
-#define UTIL_LINUX_WRITEALL_H
-
-#include &amp;lt;string.h&amp;gt;
-#include &amp;lt;unistd.h&amp;gt;
-#include &amp;lt;errno.h&amp;gt;
-
-static inline int write_all(int fd, const void *buf, size_t count)
-{
-while (count) {
-ssize_t tmp;
-
-errno = 0;
-tmp = write(fd, buf, count);
-if (tmp &amp;gt; 0) {
-count -= tmp;
-if (count)
-buf += tmp;
-} else if (errno != EINTR &amp;amp;&amp;amp; errno != EAGAIN)
-return -1;
-if (errno == EAGAIN)/* Try later, *sigh* */
-usleep(10000);
-}
-return 0;
-}
-
-static inline int fwrite_all(const void *ptr, size_t size,
-     size_t nmemb, FILE *stream)
-{
-while (nmemb) {
-size_t tmp;
-
-errno = 0;
-tmp = fwrite(ptr, size, nmemb, stream);
-if (tmp &amp;gt; 0) {
-nmemb -= tmp;
-if (nmemb)
-ptr += (tmp * size);
-} else if (errno != EINTR &amp;amp;&amp;amp; errno != EAGAIN)
-return -1;
-if (errno == EAGAIN)/* Try later, *sigh* */
-usleep(10000);
-}
-return 0;
-}
-
-#endif /* UTIL_LINUX_WRITEALL_H */
diff --git a/lib/path.c b/lib/path.c
index ad17fef..0d4d391 100644
--- a/lib/path.c
+++ b/lib/path.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -27,7 +27,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;stdio.h&amp;gt;
 #include &amp;lt;errno.h&amp;gt;
 
-#include "writeall.h"
+#include "all-io.h"
 #include "cpuset.h"
 #include "path.h"
 #include "nls.h"
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index 6bd69d3..ce14526 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -109,7 +109,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #endif
 
 #include "blkidP.h"
-#include "writeall.h"
+#include "all-io.h"
 
 /* chains */
 extern const struct blkid_chaindrv superblocks_drv;
diff --git a/login-utils/login.c b/login-utils/login.c
index 23b84a1..2b5c68d 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -66,7 +66,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "strutils.h"
 #include "nls.h"
 #include "xalloc.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "fileutils.h"
 
 #include "logindefs.h"
diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
index eb1ef02..65ee55a 100644
--- a/misc-utils/uuidd.c
+++ b/misc-utils/uuidd.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -33,7 +33,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; extern int optind;
 
 #include "uuid.h"
 #include "uuidd.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "c.h"
 #include "closestream.h"
 
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index a9d74f0..c751c3a 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -35,7 +35,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "nls.h"
 #include "xalloc.h"
 #include "strutils.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "match.h"
 #include "c.h"
 #include "closestream.h"
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index b47fede..e47b087 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -27,7 +27,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "strutils.h"
 #include "xalloc.h"
 #include "widechar.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "bitops.h"
 #include "closestream.h"
 
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index bed4cde..36e00eb 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -33,7 +33,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;grp.h&amp;gt;
 
 #include "strutils.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "nls.h"
 #include "pathnames.h"
 #include "c.h"
diff --git a/text-utils/pg.c b/text-utils/pg.c
index 2b51442..0bd8279 100644
--- a/text-utils/pg.c
+++ b/text-utils/pg.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -62,7 +62,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "nls.h"
 #include "xalloc.h"
 #include "widechar.h"
-#include "writeall.h"
+#include "all-io.h"
 #include "closestream.h"
 
 #defineREADBUFLINE_MAX/* size of input buffer */
&lt;/pre&gt;</description>
    <dc:creator>Petr Uzel</dc:creator>
    <dc:date>2012-05-15T08:49:01</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5804">
    <title>[PATCH 1/2] lib/tt: make get_terminal_width available externally</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5804</link>
    <description>&lt;pre&gt;Also, rename get_terminal_width() to tt_get_terminal_width()
to match naming convention of other exported functions.

Signed-off-by: Petr Uzel &amp;lt;petr.uzel-AlSwsSmVLrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 include/tt.h |    1 +
 lib/tt.c     |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/tt.h b/include/tt.h
index 36d3bb2..9aa04db 100644
--- a/include/tt.h
+++ b/include/tt.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -86,5 +86,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; extern struct tt_line *tt_add_line(struct tt *tb, struct tt_line *parent);
 
 extern int tt_line_set_data(struct tt_line *ln, int colnum, const char *data);
 extern int tt_line_set_userdata(struct tt_line *ln, void *data);
+extern int tt_get_terminal_width(void);
 
 #endif /* UTIL_LINUX_TT_H */
diff --git a/lib/tt.c b/lib/tt.c
index 1b5fbac..af3a34e 100644
--- a/lib/tt.c
+++ b/lib/tt.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -253,7 +253,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int tt_line_set_data(struct tt_line *ln, int colnum, const char *data)
 return 0;
 }
 
-static int get_terminal_width(void)
+int tt_get_terminal_width(void)
 {
 #ifdef TIOCGSIZE
 struct ttysizet_win;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -750,7 +750,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int tt_print_table(struct tt *tb)
 return -1;
 
 if (tb-&amp;gt;first_run &amp;amp;&amp;amp; !tb-&amp;gt;termwidth) {
-tb-&amp;gt;termwidth = get_terminal_width();
+tb-&amp;gt;termwidth = tt_get_terminal_width();
 if (tb-&amp;gt;termwidth &amp;lt;= 0)
 tb-&amp;gt;termwidth = 80;
 }
&lt;/pre&gt;</description>
    <dc:creator>Petr Uzel</dc:creator>
    <dc:date>2012-05-14T07:51:57</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5803">
    <title>[PATCH] mangle: check for end of string on every iteration</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5803</link>
    <description>&lt;pre&gt;Checking for the null byte at the end of the string only conditionally
leads to segfaults, evidenced by mount helpers crashing on writes to
/run/mount/utab. Simply check for the null on each iteration, and append
a null byte to the mangled string before breaking.

Signed-off-by: Dave Reisner &amp;lt;dreisner-fd97jBR+K/6hPH1hqNUYSQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 lib/mangle.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/mangle.c b/lib/mangle.c
index e1b4814..656918c 100644
--- a/lib/mangle.c
+++ b/lib/mangle.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -31,16 +31,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; char *mangle(const char *s)
 if (!sp)
 return NULL;
 while(1) {
+if (!*s) {
+*sp = '\0';
+break;
+}
 if (is_unwanted_char(*s)) {
 *sp++ = '\\';
 *sp++ = '0' + ((*s &amp;amp; 0300) &amp;gt;&amp;gt; 6);
 *sp++ = '0' + ((*s &amp;amp; 070) &amp;gt;&amp;gt; 3);
 *sp++ = '0' + (*s &amp;amp; 07);
-} else {
+} else
 *sp++ = *s;
-if (!*s)
-break;
-}
 s++;
 }
 return ss;
&lt;/pre&gt;</description>
    <dc:creator>Dave Reisner</dc:creator>
    <dc:date>2012-05-13T19:14:49</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5801">
    <title>[PATCH] rev.1: mention tac(1) in 'SEE ALSO' section</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5801</link>
    <description>&lt;pre&gt;Cc: James R. Van Zandt" &amp;lt;jrv-8fiUuRrzOP0dnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
From: James R. Van Zandt" &amp;lt;jrv-8fiUuRrzOP0dnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568709

Signed-off-by: Petr Uzel &amp;lt;petr.uzel-AlSwsSmVLrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 text-utils/rev.1 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/text-utils/rev.1 b/text-utils/rev.1
index 5917747..b9b5f48 100644
--- a/text-utils/rev.1
+++ b/text-utils/rev.1
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -56,3 +56,5 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; The rev command is part of the util-linux package and is available from
 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
 Linux Kernel Archive
 .UE .
+.SH SEE ALSO
+.BR tac (1)
&lt;/pre&gt;</description>
    <dc:creator>Petr Uzel</dc:creator>
    <dc:date>2012-05-13T11:57:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5798">
    <title>[PATCH 1/3] mkswap: use is_mounted() instead of check_mount()</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5798</link>
    <description>&lt;pre&gt;
Signed-off-by: Petr Uzel &amp;lt;petr.uzel-AlSwsSmVLrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 disk-utils/Makefile.am |    1 +
 disk-utils/mkswap.c    |   26 ++------------------------
 2 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/disk-utils/Makefile.am b/disk-utils/Makefile.am
index 09dfa99..ecff70e 100644
--- a/disk-utils/Makefile.am
+++ b/disk-utils/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -47,6 +47,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; swaplabel_CFLAGS = $(AM_CFLAGS) $(uuid_cflags)
 
 mkswap_SOURCES = \
 mkswap.c \
+$(top_srcdir)/lib/ismounted.c \
 $(top_srcdir)/lib/strutils.c \
 $(top_srcdir)/lib/wholedisk.c \
 $(utils_common)
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index 51a0c89..c7dedd7 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -58,6 +58,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "xalloc.h"
 #include "c.h"
 #include "closestream.h"
+#include "ismounted.h"
 
 #ifdef HAVE_LIBUUID
 # include &amp;lt;uuid.h&amp;gt;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -348,29 +349,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; get_size(const char *file)
 return size;
 }
 
-/*
- * Check to make certain that our new filesystem won't be created on
- * an already mounted partition.  Code adapted from mke2fs, Copyright
- * (C) 1994 Theodore Ts'o.  Also licensed under GPL.
- * (C) 2006 Karel Zak -- port to mkswap
- */
-static int
-check_mount(void)
-{
-FILE *f;
-struct mntent *mnt;
-
-if ((f = setmntent (_PATH_MOUNTED, "r")) == NULL)
-return 0;
-while ((mnt = getmntent (f)) != NULL)
-if (strcmp (device_name, mnt-&amp;gt;mnt_fsname) == 0)
-break;
-endmntent (f);
-if (!mnt)
-return 0;
-return 1;
-}
&lt;/pre&gt;</description>
    <dc:creator>Petr Uzel</dc:creator>
    <dc:date>2012-05-13T11:44:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5797">
    <title>[PATCH] lsblk.8: improve wording</title>
    <link>http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5797</link>
    <description>&lt;pre&gt;Cc: Regid Ichira &amp;lt;regid23-/E1597aS9LQAvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
From: Regid Ichira &amp;lt;regid23-/E1597aS9LQAvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672702

Signed-off-by: Petr Uzel &amp;lt;petr.uzel-AlSwsSmVLrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 misc-utils/lsblk.8 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc-utils/lsblk.8 b/misc-utils/lsblk.8
index 21d5838..79173da 100644
--- a/misc-utils/lsblk.8
+++ b/misc-utils/lsblk.8
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -66,8 +66,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; This option is equivalent to "-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,RO
 .IP "\fB\-V, \-\-version\fP"
 Output version information and exit.
 .SH NOTES
-For the partitions are some information (e.g. queue attributes) inherited from
-parental device.
+For partitions, some information (e.g. queue attributes) is inherited from the
+parent device.
 
 The
 .B lsblk
&lt;/pre&gt;</description>
    <dc:creator>Petr Uzel</dc:creator>
    <dc:date>2012-05-13T09:08:20</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.utilities.util-linux-ng">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.utilities.util-linux-ng</link>
  </textinput>
</rdf:RDF>

