On Fri, Apr 08, 2011 at 09:20:53PM -0300, Davidlohr Bueso wrote: > This patch produces the program to warn if the given device is misaligned. > > Signed-off-by: Davidlohr Bueso <dave@xxxxxxx> > --- > disk-utils/mkswap.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) Applied, thanks. > > diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c > index 599b9b0..33717a1 100644 > --- a/disk-utils/mkswap.c > +++ b/disk-utils/mkswap.c > @@ -588,6 +588,10 @@ main(int argc, char **argv) { > exit(EXIT_FAILURE); > } > > + if (blkdev_is_misaligned(DEV)) > + warnx(_("warning: %s is misaligned"), > + device_name); > + I have moved the code... it makes sense for block devices only. Karel > /* Want a block device. Probably not /dev/hda or /dev/hdb. */ > if (!S_ISBLK(statbuf.st_mode)) > check=0; -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html